图像翻译
季南枫(JIM)
这个作者很懒,什么都没留下…
展开
-
ZeroDivisionError: division by zero(imagecaptioning.pytorch-master)
我在运行imagecaptioning.pytorch-master工程时,在测试图像预测效果时,出现报错:ZeroDivisionError: division by zero解决方法:要将目录ImageCaptioning.pytorch-master\eval_results\下的.pth文件删除或者将下面这段代码注释掉,因为这段代码是说如果预测过就不再进行图像预测,所以注释掉就可以循环使用预测功能:# if opt.only_lang_eval == 1 or (not opt.force原创 2022-04-06 23:16:59 · 1665 阅读 · 0 评论 -
Pycharm找不到自己工程里的模块
运行程序出现找不到模块的报错:解决方法:在运行的程序中加入代码:import syssys.path.append('工程所在的绝对路径')原创 2022-02-20 11:33:59 · 1107 阅读 · 0 评论 -
ZeroDivisionError: division by zero
在跑图像翻译ImageCaptioning.pytorch-master代码时出现报错:修改方法:将eval.py文件中的74和75行用下面的代码替换:if opt.dump_json == 1:# dump the json json.dump(predictions, open('vis/vis.json', 'w'))原创 2022-02-12 21:05:39 · 982 阅读 · 1 评论 -
ModuleNotFoundError: No module named ‘用户自定义模块‘
当发现自己已经在工程中定义了自己的模块,但导入时报错说ModuleNotFoundError: No module named ‘用户自定义模块’,这有可能是没有识别出你的工程目录,可以在你的程序中加入如下语句:import osimport syssys.path.append('用户工程的绝对路径')这样,问题就解决了...原创 2021-12-09 20:08:57 · 1151 阅读 · 0 评论 -
FileNotFoundError: [Errno 2] No such file or directory: ‘./models/config.pickle‘
在跑show_attend_and_tell论文的代码时,如果出现下面的错误:说明你在命令窗口输入运行命令时没有加上模型的路径,例如:python main.py --phase=test正确的运行该程序的命令应该是:python main.py --phase=test --model_file='./models/289999.npy'...原创 2021-09-01 12:54:57 · 610 阅读 · 0 评论