book icon indicating copy to clipboard operation
book copied to clipboard

03.image_classification 报错

Open luckeriam opened this issue 5 years ago • 5 comments

Inferencer 配置和预测 代码部分运行报错

ValueErrorTraceback (most recent call last) in () 6 7 [inference_program, feed_target_names, ----> 8 fetch_targets] = fluid.io.load_inference_model(params_dirname, exe) 9 10 # The input's dimension of conv should be 4-D or 5-D.

/opt/conda/lib/python2.7/site-packages/paddle/fluid/io.pyc in load_inference_model(dirname, executor, model_filename, params_filename, pserver_endpoints) 1079 """ 1080 if not os.path.isdir(dirname): -> 1081 raise ValueError("There is no directory named '%s'", dirname) 1082 1083 if model_filename is not None:

ValueError: ("There is no directory named '%s'", 'image_classification_resnet.inference.model')

luckeriam avatar Jun 19 '19 09:06 luckeriam

根据log可以看出,您的问题首先是load时输入的维度不对,其次您提供的image_classification_resnet.inference.model这个文件夹也不存在。

wzzju avatar Jun 25 '19 06:06 wzzju

根据log可以看出,您的问题首先是load时输入的维度不对,其次您提供的image_classification_resnet.inference.model这个文件夹也不存在。

我是按照book 里的代码执行的,请帮忙查看

luckeriam avatar Jun 25 '19 06:06 luckeriam

根据log可以看出,您的问题首先是load时输入的维度不对,其次您提供的image_classification_resnet.inference.model这个文件夹也不存在。

我是按照book 里的代码执行的,请帮忙查看

请您提供参考的book示例的链接。

wzzju avatar Jun 25 '19 06:06 wzzju

https://github.com/PaddlePaddle/book/blob/develop/03.image_classification/README.cn.md

luckeriam avatar Jun 25 '19 07:06 luckeriam

另外训练主循环以及过程输出 报错: NameErrorTraceback (most recent call last) in () ----> 1 train_loop()

in train_loop() 34 if params_dirname is not None: 35 fluid.io.save_inference_model(params_dirname, ["pixel"], ---> 36 [predict], exe)

NameError: global name 'predict' is not defined @shippingwang 用户还遇到的问题,请您帮忙看看哈。

wzzju avatar Jun 25 '19 07:06 wzzju