InstColorization icon indicating copy to clipboard operation
InstColorization copied to clipboard

Google colab demo problem

Open Riretta opened this issue 3 years ago • 5 comments

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'

Riretta avatar Nov 08 '20 13:11 Riretta

Yeah the checkpoint zip fails

limeysoda avatar Nov 08 '20 16:11 limeysoda

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.

ericsujw avatar Nov 09 '20 06:11 ericsujw

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 [email protected] 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 avatar Nov 09 '20 08:11 Riretta

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)

https://localhost:8080/# 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 https://localhost:8080/# in rgb2xyz(rgb) 86 rgb = (((rgb+.055)/1.055)**2.4)mask + rgb/12.92(1-mask) 87 ---> 88 x = .412453rgb[:,0,:,:]+.357580rgb[:,1,:,:]+.180423rgb[:,2,:,:] 89 y = .212671rgb[:,0,:,:]+.715160rgb[:,1,:,:]+.072169rgb[:,2,:,:] 90 z = .019334rgb[:,0,:,:]+.119193rgb[:,1,:,:]+.950227*rgb[:,2,:,:]

IndexError: index 2 is out of bounds for dimension 1 with size 2

            **Rita Pucci** ~ https://ritapucci.wordpress.com/

[email protected] || [email protected] || [email protected] || [email protected]

Il giorno lun 9 nov 2020 alle ore 09:05 Rita Pucci [email protected] 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 [email protected] 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 https://github.com/ericsujw/InstColorization/issues/21#issuecomment-723783884, or unsubscribe https://github.com/notifications/unsubscribe-auth/ALGLSM5C3E562WW3AVFKYXLSO6B77ANCNFSM4TOKVWFA .

Riretta avatar Nov 09 '20 11:11 Riretta

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

dkuku avatar Dec 21 '20 08:12 dkuku