SpA-Former-shadow-removal
SpA-Former-shadow-removal copied to clipboard
predict.py error
Running predict.py
leads to an error:
python predict.py
Traceback (most recent call last):
File "predict.py", line 13, in <module>
from untitled1 import Generator
ModuleNotFoundError: No module named 'untitled1'
I have changed it. So you can try again. Best wishes
Running predict.py leads to an error: File "predict1.py", line 57, in predict allim[0, 2, :] = heat_att IndexError: index 2 is out of bounds for axis 1 with size 1
你可以把报错多放点上来,代码应该是没有问题的,是不是索引测试数据集的问题,都要resize成640X480,具体批量resize可以看我代码里的bigresize.py
已经把图像resize成了640*480 在predict.py文件中
allim[0, 0, :] = in_rgb * 255
allim[0, 0, :] = out_rgb * 255
allim[0, 2, :] = heat_att
allim的shape是[1,1,3,480,640],对于最后一行的2,超出了索引。具体错误如下:
(cq) [chenqing@8p100 ~/cq1/SpA-Former-shadow-removal-main]$ python predict1.py --config ./config.yml --test_dir ./data/predict/ --out_dir ./out --pretrained ./results/000001/models/gen_model_epoch_160.pth --cuda
Random Seed: 0
===> Loading models
0%| | 0/1 [00:01<?, ?it/s]
Traceback (most recent call last):
File "predict1.py", line 83, in
你的预训练模型放的路径位置对吗,不用跟我一模一样
如果报错的话,你可以把allim[0, 2, :] = heat_att这边注释,这个是注意力热图,注释了还是可以输出预测图的
您好 这个predict.py的测速集是必须和训练集一样有test-A test-B test-C三个数据集吗?我是想做一个推理,输进去一个图片,输出去阴影之后的图片,这个是用哪个py文件啊
不是的,只需要test-A一个就行了,里面是带有阴影的图片,就运行predict.py就行,路径填对,应该没问题
不是的,只需要test-A一个就行了,里面是带有阴影的图片,就运行predict.py就行,路径填对,应该没问题
现在可以运行成功,但是好像没有效果啊,得到的结果还是有阴影。python predict.py --config ./config.yml --test_dir ./data/predict/ --out_dir ./out --pretrained ./results/000001/models/gen_model_epoch_160.pth --cuda 这些路经都没有问题
把图放上来看看呢
我建议你可以把图resize成256x256
我建议你可以把图resize成256x256
刚刚尝试了把图片resize成256之后还是不行。感觉得到的结果和原始图像没有区别。这是为什么啊?下面是模型的进程,应该是没错误的吧 (cq) [chenqing@8p100 ~/cq1/SpA-Former-shadow-removal-main]$ python predict1.py --config ./config.yml --test_dir ./data/predict/ --out_dir ./out --pretrained ./results/000001/models/gen_model_epoch_160.pth --cuda Random Seed: 0 ===> Loading models 100%|█████████████████████████████████████████████████████████████████████████| 7/7 [00:01<00:00, 3.68it/s]
蛮奇怪的,我在上传我的可视化结果到谷歌云,有可能跟显卡有关,我用的是3090,但是不至于说一点都推断不出来
![]()
蛮奇怪的,我在上传我的可视化结果到谷歌云,有可能跟显卡有关,我用的是3090,但是不至于说一点都推断不出来
我设置的输出路径是out/ , 实际得到推断的路径是out/epoch_0001/ 这是合理的吗?
合理的
I have changed it. So you can try again. Best wishes
I am having the same untitled1 problem, where can I update to fix it?