ericsujw / InstColorization

MIT License
712 stars 152 forks source link

Google colab demo problem #21

Open Riretta opened 4 years ago

Riretta commented 4 years ago

Using unmodified Googlecolab I got this error:

model = create_model(opt) model.setup_to_test('coco_finetuned_mask_256_ffs')

initialize network with normal initialize network with normal initialize network with normal model [FusionModel] was created load Fusion model from checkpoints/coco_finetuned_mask_256_ffs/latest_net_GF.pth

FileNotFoundError Traceback (most recent call last)

in () 1 model = create_model(opt) ----> 2 model.setup_to_test('coco_finetuned_mask_256_ffs') 3 frames /usr/local/lib/python3.6/dist-packages/torch/serialization.py in __init__(self, name, mode) 213 class _open_file(_opener): 214 def __init__(self, name, mode): --> 215 super(_open_file, self).__init__(open(name, mode)) 216 217 def __exit__(self, *args): FileNotFoundError: [Errno 2] No such file or directory: 'checkpoints/coco_finetuned_mask_256_ffs/latest_net_GF.pth'
limeysoda commented 4 years ago

Yeah the checkpoint zip fails

ericsujw commented 4 years ago

Do you run the section 4 for downloading the model?

!sh scripts/download_model.sh

I've just checked the notebook, and still not found any problem.

Riretta commented 4 years ago

I did it but if you say so i try again! Thank you! I’ll let you know soon

Sent from my iPhone

On 9 Nov 2020, at 07:13, ericsujw notifications@github.com wrote:

 Do you run the section 4 for downloading the model?

!sh scripts/download_model.sh

I've just checked the notebook, and still not found any problem.

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

Riretta commented 4 years ago

now I found the model pretrained, but I have problems in colorizing my dataset with the colab. In particular, I uploaded my images in example folder, and I create the dataloaded dataset but when I run the "Start to colorize every images in dataset_loader."

/usr/local/lib/python3.6/dist-packages/ipykernel_launcher.py:2: TqdmDeprecationWarning: This function will be removed in tqdm==5.0.0 Please use tqdm.notebook.tqdm instead of tqdm.tqdm_notebook

0% 0/217 [00:00<?, ?it/s]

torch.Size([1, 1, 2, 256, 256])


IndexError Traceback (most recent call last)

in () 10 print(data_raw['full_img'].shape) 11 #cropped_data = util.get_colorization_data(data_raw['cropped_img'], opt, ab_thresh=0, p=opt.sample_p) ---> 12 full_img_data = util.get_colorization_data(data_raw['full_img'], opt, ab_thresh=0, p=opt.sample_p) 13 model.set_input(full_img_data) 14 model.set_fusion_input(full_img_data, [box_info, box_info_2x, box_info_4x, box_info_8x]) ------------------------------ 2 frames ------------------------------ /content/InstColorization/util/util.py in rgb2xyz(rgb) 86 rgb = (((rgb+.055)/1.055)**2.4)*mask + rgb/12.92*(1-mask) 87 ---> 88 x = .412453*rgb[:,0,:,:]+.357580*rgb[:,1,:,:]+.180423*rgb[:,2,:,:] 89 y = .212671*rgb[:,0,:,:]+.715160*rgb[:,1,:,:]+.072169*rgb[:,2,:,:] 90 z = .019334*rgb[:,0,:,:]+.119193*rgb[:,1,:,:]+.950227*rgb[:,2,:,:] IndexError: index 2 is out of bounds for dimension 1 with size 2 **Rita Pucci** ~ https://ritapucci.wordpress.com/ rita.pucci85@gmail.com || rita.pucci@uniud.it || riretta@hotmail.com || puccir@cli.di.unipi.it Il giorno lun 9 nov 2020 alle ore 09:05 Rita Pucci ha scritto: > I did it but if you say so i try again! Thank you! I’ll let you know soon > > Sent from my iPhone > > On 9 Nov 2020, at 07:13, ericsujw wrote: > >  > > Do you run the section 4 for downloading the model? > > !sh scripts/download_model.sh > > I've just checked the notebook, and still not found any problem. > > — > You are receiving this because you authored the thread. > Reply to this email directly, view it on GitHub > , > or unsubscribe > > . > >
dkuku commented 3 years ago

I managed to get it working https://colab.research.google.com/drive/10bz3OhNOJ-Ojbse0H6UM1a4VUAxKEe47?usp=sharing