pbaylies / stylegan-encoder

StyleGAN Encoder - converts real images to latent space
Other
740 stars 182 forks source link

RuntimeError: cannot join current thread #45

Closed aiXander closed 4 years ago

aiXander commented 4 years ago

Encoding process crashes when trying to exit the tqdm() loop:

[00:51, 51.92s/it]
Exception ignored in: <bound method tqdm.__del__ of img_01: loss 84.5358; lr 0.0064:   9% 18/200 [00:25<01:46,  1.70it/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

************ Latent code optimization finished! ***************

This might be related to this tqdm issue, but I'm not entirely sure. It might be another issue that I can't see from the traceback, tried for an hour to fix it without luck.

To reproduce you can run this Colab Notebook.

aiXander commented 4 years ago

This issue arised when using Google Colab since it runs tqdm 4.28 for some reason... Manually updating the tqdm version fixed everything!

!pip install --upgrade tqdm