Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

运行demo\image_classification\img_classifier.py时报错 #487

Closed
gaooolianggg opened this issue Mar 31, 2020 · 3 comments
Closed

运行demo\image_classification\img_classifier.py时报错 #487

gaooolianggg opened this issue Mar 31, 2020 · 3 comments
Assignees

Comments

@gaooolianggg
Copy link

欢迎您反馈PaddleHub使用问题,非常感谢您对PaddleHub的贡献!
在留下您的问题时,辛苦您同步提供如下信息:

  • 版本、环境信息
    1)PaddleHub和PaddlePaddle版本:请提供您的PaddleHub和PaddlePaddle版本号,例如PaddleHub1.4.1,PaddlePaddle1.6.2
    2)系统环境:请您描述系统类型,例如Linux/Windows/MacOS/,python版本
  • 复现信息:如为报错,请给出复现环境、复现步骤

你好,我在win10 64位系统中运行img_classifier.py时,会出现
InvalidArgumentError: Tensor holds the wrong type, it holds int, but desires to be int64_t.
我的paddle版本是1.7.1 paddlehub版本为1.6.0
python版本为3.7.7
我在网上搜索了相关信息,发现paddle的官方csdn文档中提到过可能因为系统的默认数据类型不同,导致windows中会出现错误,那个文档中是这样回答的:

【该问题很有可能是paddle.fluid.layers.data定义的输入类型不正确,Fluid中需要注意的是对于float而言,float32是主要实数类型,而对int而言,int64是主要标签类型。在使用时,最好对应上。】

但我不知道如何在这个例子中进行修改,能够帮忙解决,谢谢!

@kinghuin
Copy link
Contributor

@gaooolianggg Hi,感谢您的问题反馈。请尝试在此处 新增参数use_pyreader=False

@gaooolianggg
Copy link
Author

谢谢,解决了我的问题

@haoyuying
Copy link
Contributor

Since you haven't replied for more than 3 months, we have closed this issue/pr.
If the problem is not solved or there is a follow-up one, please reopen it at any time and we will continue to follow up.
由于您超过三个月未回复,我们将关闭这个issue/pr。
若问题未解决或有后续问题,请随时重新打开,我们会继续跟进。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants