Skip to content

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

Open

Description

@huanFigure

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的数组

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions