StyleCLIP icon indicating copy to clipboard operation
StyleCLIP copied to clipboard

Colab broken with permission denied error for e4e_ffhq_encode.pt

Open danijar opened this issue 4 years ago • 3 comments

Running the global colab gives this error:

Permission denied: https://drive.google.com/uc?id=1O8OLrVNOItOJoNGMyQ8G8YRTeTYEfs0P
Maybe you need to change permission over 'Anyone with the link'?

I don't know why this happens because when I manually open the download link in a tab it lets me download the file.

danijar avatar Jun 29 '21 14:06 danijar

Just download the file manually, upload it to your Google drive, link your Google drive to the colab, then drag the file into the encoder4editing folder.

maparicio23 avatar Jun 29 '21 15:06 maparicio23

Downloaded the file manually then uploaded to the right place.

I'm having a new issue when loading it with torch:

RuntimeError                              Traceback (most recent call last)
<ipython-input-4-c5ec48afcc25> in <module>()
     17 
     18 model_path = EXPERIMENT_ARGS['model_path']
---> 19 ckpt = torch.load(model_path, map_location='cpu')
     20 opts = ckpt['opts']
     21 # pprint.pprint(opts)  # Display full options used

1 frames
/usr/local/lib/python3.7/dist-packages/torch/serialization.py in __init__(self, name_or_buffer)
    240 class _open_zipfile_reader(_opener):
    241     def __init__(self, name_or_buffer) -> None:
--> 242         super(_open_zipfile_reader, self).__init__(torch._C.PyTorchFileReader(name_or_buffer))
    243 
    244 

RuntimeError: [enforce fail at inline_container.cc:145] . PytorchStreamReader failed reading zip archive: failed finding central directory

gmanolache avatar Jun 29 '21 20:06 gmanolache

You can use the pydrive downloader, similary to this notebook (first cell)

Then:

downloader.download_file("1O8OLrVNOItOJoNGMyQ8G8YRTeTYEfs0P", "/content/encoder4editing/e4e_ffhq_encode.pt")

rmokady avatar Feb 23 '22 13:02 rmokady