Comments (23)
Fixed it! Instead of using the link as such:
https://drive.google.com/file/d/{file_id}
You should use the link in the following format:
https://drive.google.com/uc?id={file_id}
from stylegan-encoder.
This is a known issue with Google Drive quotas; as a workaround, you can try to go into that Google Drive, share the file to your own account, and then make a copy there and download that URL. Also note that when you do download it, you'll have it stored locally in a cache directory if you need it later.
from stylegan-encoder.
Thank you so much i resolved it. The problem was in the tqdm version pre-installed in google colab.
I had to downgrade to tqdm==4.24.0
!pip install --force tqdm==4.24.0
from stylegan-encoder.
I have same issue but my laptop doesn't have GPU any way I can perform it on colab only.I am using only 3 images for my purpose.
here is what you need to do:
1- download the pickle file manually (from the link that the error already shows)
2- upload it to your google drive
3- change the sharing option from only you to anyone with the link.
4- generate and copy the sharing link from of uploaded file from your google drive
5- in the link change the file/d/ part to uc?id=
6- delete the ending part (/view?usp=sharing)
7- from file tab of your colab notebook, find and click on encode_images.py
8- on the right side of your browser the code will open. find the parsers sections
9- find the line which gives the default url to load the pickle file: parser.add_argument('--model_url', default=
10- change the url to what we created in the previous steps.
thats it.
from stylegan-encoder.
Thank you for your response. That's exactely what i did and it worked!. However, i am getting this error now:
File "encode_images.py", line 116, in main generator_network, discriminator_network, Gs_network = pickle.load(f) _pickle.UnpicklingError: invalid load key, '<'.
from stylegan-encoder.
I've seen this issue before; make sure you're using Python 3, that your file downloaded properly, and if that doesn't work, then try using encoding='latin1' when you load the pickled file:
pickle.load(f, encoding='latin1')
from stylegan-encoder.
I tried what you suggested but it doesn't work. I am getting the same error.
File "encode_images.py", line 116, in main generator_network, discriminator_network, Gs_network = pickle.load(f, encoding='latin1') _pickle.UnpicklingError: invalid load key, '<'.
from stylegan-encoder.
Then make sure the file is correct; good luck!
from stylegan-encoder.
I solved it, but i am struggling with that one now :|
Exception ignored in: <bound method tqdm.__del__ of yassine2_01: loss 103.8618; lr 0.0051: 12% 12/100 [00:17<01:06, 1.33it/s]> Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/tqdm/_tqdm.py", line 931, in __del__ self.close() File "/usr/local/lib/python3.6/dist-packages/tqdm/_tqdm.py", line 1133, in close self._decr_instances(self) File "/usr/local/lib/python3.6/dist-packages/tqdm/_tqdm.py", line 496, in _decr_instances cls.monitor.exit() File "/usr/local/lib/python3.6/dist-packages/tqdm/_monitor.py", line 52, in exit self.join() File "/usr/lib/python3.6/threading.py", line 1053, in join raise RuntimeError("cannot join current thread") RuntimeError: cannot join current thread
It is a big problem when you don't have enough ressources.
from stylegan-encoder.
Oh interesting, I never would have guessed that; glad you figured it out!
from stylegan-encoder.
I tried what you suggested but it doesn't work. I am getting the same error.
File "encode_images.py", line 116, in main generator_network, discriminator_network, Gs_network = pickle.load(f, encoding='latin1') _pickle.UnpicklingError: invalid load key, '<'.
Hi there. I'm having the same problem with the "invalid load key" in the google colab.
Could you enlighten me with how you solved that problem ?
Much thx.
from stylegan-encoder.
Never mind. I figured it out.
I used the shareable link, not the download url to the file.
THX.
from stylegan-encoder.
can you please elaborate how you solved it?
from stylegan-encoder.
Hi, I used the shareable link to the file and I'm still facing this issue:
Traceback (most recent call last): File "encode_images.py", line 247, in <module> main() File "encode_images.py", line 122, in main generator_network, discriminator_network, Gs_network = pickle.load(f) _pickle.UnpicklingError: invalid load key, '<'.
Some elaboration on a solution would be highly appreciated. I'm on Python 3.6.9
from stylegan-encoder.
Hi, I've tried everything on this post and searched the internet, yet nothing woks. When I run encode_images.py
with the default URL it throws a quota exceeded error. when I put a different URL (for say the copy I made for myself) I get the pickling error:
Traceback (most recent call last):
File "encode_images.py", line 241, in <module>
main()
File "encode_images.py", line 116, in main
generator_network, discriminator_network, Gs_network = pickle.load(f, encoding='latin1')
_pickle.UnpicklingError: invalid load key, '<'.
If anyone solved this or has a link to a working pretrained model I'd highly appreciate it
from stylegan-encoder.
I have same issue.
from stylegan-encoder.
I have same issue but my laptop doesn't have GPU any way I can perform it on colab only.I am using only 3 images for my purpose.
from stylegan-encoder.
but still it is giving
from stylegan-encoder.
Hi, I've tried everything on this post and searched the internet, yet nothing woks. When I run
encode_images.py
with the default URL it throws a quota exceeded error. when I put a different URL (for say the copy I made for myself) I get the pickling error:Traceback (most recent call last): File "encode_images.py", line 241, in <module> main() File "encode_images.py", line 116, in main generator_network, discriminator_network, Gs_network = pickle.load(f, encoding='latin1') _pickle.UnpicklingError: invalid load key, '<'.
If anyone solved this or has a link to a working pretrained model I'd highly appreciate it
I have the same issue
from stylegan-encoder.
Has anyone figured this out? I somehow got this all to work a while ago but I forget what I did, and have reinstalled my OS since then. Very frustrating issue. I am in the exact same position as @utaccn
from stylegan-encoder.
I gave up and I did use stylegan2 @nhorton04
from stylegan-encoder.
Has anyone figured this out? I somehow got this all to work a while ago but I forget what I did, and have reinstalled my OS since then. Very frustrating issue. I am in the exact same position as @utaccn
Once you have a link it looks like this:
https://drive.google.com/file/d/1wTczzzzzzzzzzzzzzzzzzzzzzycaBq8Or/view?usp=sharing
there are 3 changes that you should do before being able to share that file:
1- change the pickle.load(f) to pickle.load(f, encoding='latin1')
2- change the shareable link to: https://drive.google.com/uc?id=1wTczzzzzzzzzzzzzzzzcaBq8Or
pay attention we modify 2 parts: a) uc?id= && b)delete the last part
3- make sure your link is changed to be shared with anyone from your google drive settings
good luck
from stylegan-encoder.
I have same issue but my laptop doesn't have GPU any way I can perform it on colab only.I am using only 3 images for my purpose.
here is what you need to do:
1- download the pickle file manually (from the link that the error already shows)
2- upload it to your google drive
3- change the sharing option from only you to anyone with the link.
4- generate and copy the sharing link from of uploaded file from your google drive
5- in the link change the file/d/ part to uc?id=
6- delete the ending part (/view?usp=sharing)
7- from file tab of your colab notebook, find and click on encode_images.py
8- on the right side of your browser the code will open. find the parsers sections
9- find the line which gives the default url to load the pickle file: parser.add_argument('--model_url', default=
10- change the url to what we created in the previous steps.
thats it.
@serarmani
This worked really well.
However, I'd make this suggestion:
Instead of modifying the encode_images.py file, use the command line flag instead.
Modify (from the fast version):
!python encode_images.py --optimizer=lbfgs --face_mask=True --iterations=6 --use_lpips_loss=0 --use_discriminator_loss=0 --output_video=True aligned_images/ generated_images/ latent_representations/
to be:
!python encode_images.py --model_url=ADD_LINK_HERE --optimizer=lbfgs --face_mask=True --iterations=6 --use_lpips_loss=0 --use_discriminator_loss=0 --output_video=True aligned_images/ generated_images/ latent_representations/
Obviously, change ADD_LINK_HERE to be the google drive link you created in the previous step. No quotes needed.
from stylegan-encoder.
Related Issues (20)
- Error running encode_images.py on Colab HOT 2
- Error while running encode_images.py #41
- google drive exceeded encode_images.py
- Two bugs found HOT 2
- AttributeError: module 'tensorflow' has no attribute 'Dimension' HOT 2
- Face Alignment results in exception error
- Compatibility with pretrained stylegan2 model? HOT 7
- train encoder directly HOT 1
- requirements.txt empty and compatibility issues HOT 1
- assert img.shape == self.shape Assertion Error HOT 6
- How to interpolate a one region of two faces? HOT 1
- Why can't we find the vector Z and have to use W ? HOT 2
- runing StyleGAN_Encoder sehape error HOT 2
- Weird error, how do I fix it???'
- Why requirments.txt is empty HOT 1
- Getting error while run the 'encode_images.py' file
- 'latent_training_data' is no longer available HOT 1
- PreTrained Model HOT 1
- tf compatibility issue
- _pickle.UnpicklingError: invalid load key, '<'. HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from stylegan-encoder.