Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FileNotFoundError in Colab Demo #20

Open
PiotrMi opened this issue Nov 8, 2020 · 4 comments
Open

FileNotFoundError in Colab Demo #20

PiotrMi opened this issue Nov 8, 2020 · 4 comments

Comments

@PiotrMi
Copy link

PiotrMi commented Nov 8, 2020

Using the unmodified Google Colab Demo.
I think it has something to do with the zip file not being downloaded correctly. The size of the zip is only around 3KB. Maybe the Google Drive download is being rate limited?

Error:

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)
<ipython-input-11-e948e7e9ae19> in <module>()
      1 model = create_model(opt)
----> 2 model.setup_to_test('coco_finetuned_mask_256_ffs')

3 frames
/content/InstColorization/models/fusion_model.py in setup_to_test(self, fusion_weight_path)
     95         GF_path = 'checkpoints/{0}/latest_net_GF.pth'.format(fusion_weight_path)
     96         print('load Fusion model from %s' % GF_path)
---> 97         GF_state_dict = torch.load(GF_path)
     98 
     99         # G_path = 'checkpoints/coco_finetuned_mask_256/latest_net_G.pth' # fine tuned on cocostuff

/usr/local/lib/python3.6/dist-packages/torch/serialization.py in load(f, map_location, pickle_module, **pickle_load_args)
    582         pickle_load_args['encoding'] = 'utf-8'
    583 
--> 584     with _open_file_like(f, 'rb') as opened_file:
    585         if _is_zipfile(opened_file):
    586             with _open_zipfile_reader(f) as opened_zipfile:

/usr/local/lib/python3.6/dist-packages/torch/serialization.py in _open_file_like(name_or_buffer, mode)
    232 def _open_file_like(name_or_buffer, mode):
    233     if _is_path(name_or_buffer):
--> 234         return _open_file(name_or_buffer, mode)
    235     else:
    236         if 'w' in mode:

/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'
@ericsujw
Copy link
Owner

ericsujw commented Nov 9, 2020

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.

@PiotrMi
Copy link
Author

PiotrMi commented Nov 9, 2020

Yes, I ran the script. This is it's output:

Downloading...
Finish download.
Archive:  checkpoints.zip
  End-of-central-directory signature not found.  Either this file is not
  a zipfile, or it constitutes one disk of a multi-part archive.  In the
  latter case the central directory and zipfile comment will be found on
  the last disk(s) of this archive.
unzip:  cannot find zipfile directory in one of checkpoints.zip or
        checkpoints.zip.zip, and cannot find checkpoints.zip.ZIP, period.

@sparanoid
Copy link

sparanoid commented Nov 10, 2020

Got the same issue when ran from localhost. But it works on Colab.

@Twenkid
Copy link

Twenkid commented Mar 11, 2022

I am getting the error on Colab. I guess outdated link, and still I can't find another location.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants