Closed yuanjim closed 2 years ago
ValueError: parameter name [conv1_weights] have be been used. In dygraph mode, the name of parameter can't be same.Please check the parameter attr value passed to self.create_parameter or constructor of dygraph Layers
从错误来看,您使用的代码不是最新的。最新代码,没有"conv1_weights"这样的命名。
已解决。出现上述问题的原因是在内存中重复创建了推理模型,所以将创建推理放在flask路由实例前即可。
Checklist:![image](https://user-images.githubusercontent.com/46877936/142564252-9e3de226-a31f-42bb-9955-819f8f64d8fd.png)
描述问题/Describe the bug
A clear and concise description of what the bug is. flask启动后,第一次调用是正常的,但是第二次调用infer就出现如上问题了。
复现/Reproduction![image](https://user-images.githubusercontent.com/46877936/142564252-9e3de226-a31f-42bb-9955-819f8f64d8fd.png)
results = infer(save_path)
-----------------------------------save_path:------------------------------ ['/Users/yuanjing/jim/projects_list/0024_infrared_image_detection/coco/val_from_flask/img4predict.jpg']