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

ProgramEntrance_2.py读取imagenet图片reshape报错 #565

Open
huanFigure opened this issue Jun 11, 2024 · 0 comments
Open

ProgramEntrance_2.py读取imagenet图片reshape报错 #565

huanFigure opened this issue Jun 11, 2024 · 0 comments

Comments

@huanFigure
Copy link

ProgramEntrance_2.py读取imagenet图片报错,reshape失败
arr = np.fromfile(path, dtype=np.dtype('float32')).reshape([1, 3, 224, 224])
因为reshape不可改变数据的元素数量,所以如果imagenet的图片大小与reshape的值不匹配会报错,所以示例代码应该先处理图片大小格式为3,224,224,再转为np的数组

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

1 participant