未验证 提交 69758601 编写于 作者: K kinghuin 提交者: GitHub

fix img_cls bugs (#519)

上级 c226c735
......@@ -25,11 +25,11 @@ from paddlehub.dataset.base_cv_dataset import BaseCVDataset
class Food101Dataset(BaseCVDataset):
def __init__(self):
dataset_path = os.path.join(hub.common.dir.DATA_HOME, "food-101",
"images")
base_path = self._download_dataset(
dataset_path = os.path.join(hub.common.dir.DATA_HOME, "food-101")
dataset_path = self._download_dataset(
dataset_path=dataset_path,
url="https://bj.bcebos.com/paddlehub-dataset/Food101.tar.gz")
base_path = os.path.join(dataset_path, "images")
super(Food101Dataset, self).__init__(
base_path=base_path,
train_list_file="train_list.txt",
......
......@@ -163,7 +163,7 @@ class ImageClassificationReader(BaseReader):
for image_path, label in data:
image = preprocess(image_path)
images.append(image.astype('float32'))
labels.append([int(label)])
labels.append([np.int64(label)])
if len(images) == batch_size:
if return_list:
......
......@@ -13,5 +13,5 @@
# See the License for the specific language governing permissions and
# limitations under the License.
""" PaddleHub version string """
hub_version = "1.6.0"
hub_version = "1.6.2"
module_proto_version = "1.0.0"
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册