MegEngine / Models

采用MegEngine实现的各种主流深度学习模型
Other
303 stars 99 forks source link

Missing Code(代码遗漏导致无法运行) #107

Closed MondayZhou closed 3 years ago

MondayZhou commented 3 years ago

https://github.com/MegEngine/Models/blob/11013f6b3b252df71098b27714e39d9802d2520d/official/vision/classification/shufflenet/inference.py#L63

Missing Code

There is one line of missing code for transforming ndarray into tensor. It will lead to an error: 该码下遗漏了一行将ndarray转换成tensor的代码,导致在运行的时候报错:

TypeError: op Convolution expect type Tensor as inputs, got numpy.ndarray actually

Solution

Adding these below L63: L63下面应添加:

    processed_img = megengine.tensor(processed_img, dtype="float32")
haolongzhangm commented 3 years ago

@MondayZhou 如果可能的话, 帮忙提一个PR