knazeri / edge-connect

EdgeConnect: Structure Guided Image Inpainting using Edge Prediction, ICCV 2019 https://arxiv.org/abs/1901.00212
http://openaccess.thecvf.com/content_ICCVW_2019/html/AIM/Nazeri_EdgeConnect_Structure_Guided_Image_Inpainting_using_Edge_Prediction_ICCVW_2019_paper.html
Other
2.5k stars 530 forks source link

pre-trained models run errors #130

Open xiaoming3526 opened 4 years ago

xiaoming3526 commented 4 years ago

I downloaded the pre-training model to see the effect of the model. Instead of generating flist file, I directly tested it, and the following error occurred:

python test.py --checkpoints ./checkpoints/places2 --input ./examples/places2/images --mask ./examples/places2/masks --output ./checkpoints/results --model 3

Loading EdgeModel generator... Loading InpaintingModel generator...

start testing...

loading error: ./examples/places2/images/places2_01.png Traceback (most recent call last): File "/home/fanming_maming_cs/fm/edge-connect-master/src/dataset.py", line 41, in getitem item = self.load_item(index) File "/home/fanming_maming_cs/fm/edge-connect-master/src/dataset.py", line 83, in load_item return self.to_tensor(img), self.to_tensor(img_gray), self.to_tensor(edge), self.to_tensor(mask) File "/home/fanming_maming_cs/fm/edge-connect-master/src/dataset.py", line 155, in to_tensor img_t = F.to_tensor(img).float() File "/root/miniconda3/envs/edge-connect/lib/python3.6/site-packages/torchvision/transforms/functional.py", line 71, in to_tensor img = img.view(pic.size[1], pic.size[0], nchannel) RuntimeError: shape '[256, 256, 1]' is invalid for input of size 262144

Please help to check if there are any mistakes. Thank you!

songzihang commented 4 years ago

Hello~ I have the same question with you . I wonder if you have solved the problem~

xiaoming3526 commented 4 years ago

Hello~ I have the same question with you . I wonder if you have solved the problem~

Sorry, I didn't modify it successfully~we can talk about it

songzihang commented 4 years ago

中国人说中文吧hahh 我微信号zihang_song------------------ 原始邮件 ------------------ 发件人: "xiaoming3526"notifications@github.com 发送时间: 2019年11月22日(星期五) 晚上6:17 收件人: "knazeri/edge-connect"edge-connect@noreply.github.com; 抄送: "songzihang"942737735@qq.com;"Comment"comment@noreply.github.com; 主题: Re: [knazeri/edge-connect] pre-trained models run errors (#130)

Hello~ I have the same question with you . I wonder if you have solved the problem~

Sorry, I didn't modify it successfully~we can talk about it

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or unsubscribe.

anshen666 commented 4 years ago

你好,我最近也在跑这个代码。可以加你交流一下吗?我的微信:loveanshen 我的QQ:519838354 我的邮箱:519838354@qq.com 非常期待你百忙中的回复

anshen666 commented 4 years ago

Hello~ I have the same question with you . I wonder if you have solved the problem~

你好,我最近也在跑这个代码。可以加你交流一下吗?我的微信:loveanshen 我的QQ:519838354 我的邮箱:519838354@qq.com 非常期待你百忙中的回复

redaghanem commented 4 years ago

i am also get this error

Loading InpaintingModel generator...

start testing...

Traceback (most recent call last): File "test.py", line 2, in main(mode=2) File "/content/drive/My Drive/Colab Notebooks/lafin-master/main.py", line 61, in main model.test() File "/content/drive/My Drive/Colab Notebooks/lafin-master/src/lafin.py", line 284, in test for items in test_loader: File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/dataloader.py", line 346, in next data = self._dataset_fetcher.fetch(index) # may raise StopIteration File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch data = [self.dataset[idx] for idx in possibly_batched_index] File "/usr/local/lib/python3.6/dist-packages/torch/utils/data/_utils/fetch.py", line 44, in data = [self.dataset[idx] for idx in possibly_batched_index] File "/content/drive/My Drive/Colab Notebooks/lafin-master/src/dataset.py", line 39, in getitem item = self.load_item(index) File "/content/drive/My Drive/Colab Notebooks/lafin-master/src/dataset.py", line 54, in load_item landmark = self.load_lmk([size, size], index, img.shape) File "/content/drive/My Drive/Colab Notebooks/lafin-master/src/dataset.py", line 105, in load_lmk landmarks = np.genfromtxt(self.landmark_data[index]) IndexError: list index out of range

when run this command in google colab

!python test.py --model 2 --checkpoints checkpoints/celeba_models --input examples/images --mask examples/masks --output checkpoints/results

897486562 commented 4 years ago

I wonder if you have solved the problem. I have the same problem. Can you help me to solve it?

czzyyy commented 4 years ago

I solved the problem by changing the "torchvision" to the version "torchvision-0.2.2".