texturedesign / texturize

🤖🖌️ Generate photo-realistic textures based on source images or (soon) PBR materials. Remix, remake, mashup! Useful if you want to create variations on a theme or elaborate on an existing texture.
GNU Affero General Public License v3.0
706 stars 32 forks source link

AttributeError: module 'progressbar' has no attribute 'DataSize' #7

Closed rainerkohlberger closed 4 years ago

rainerkohlberger commented 4 years ago

hi, sorry one more after the update to creativeai 0.1.1:

Traceback (most recent call last):
  File "/home/rainer/miniconda3/envs/myenv/bin/texturize", line 11, in <module>
    load_entry_point('texturize', 'console_scripts', 'texturize')()
  File "/home/rainer/dev/texturize/src/texturize/__main__.py", line 277, in main
    result = process_file(config, filename)
  File "/home/rainer/dev/texturize/src/texturize/__main__.py", line 157, in process_file
    for octave, result_img in process_image(config, io.load_image_from_file(source)):
  File "/home/rainer/.local/lib/python3.8/site-packages/torch/autograd/grad_mode.py", line 26, in generator_context
    x = next(gen)
  File "/home/rainer/dev/texturize/src/texturize/__main__.py", line 190, in process_image
    encoder = models.VGG11(pretrained=True, pool_type=torch.nn.AvgPool2d)
  File "/home/rainer/.local/lib/python3.8/site-packages/creativeai/image/encoders/models.py", line 52, in __init__
    super(VGG11, self).__init__(block_type, pool_type, input_type="RGB", **kwargs)
  File "/home/rainer/.local/lib/python3.8/site-packages/creativeai/image/encoders/base.py", line 33, in __init__
    self.load_pretrained(self.FILENAME, self.HEXDIGEST)
  File "/home/rainer/.local/lib/python3.8/site-packages/creativeai/image/encoders/base.py", line 36, in load_pretrained
    fullpath = io.download_to_file(model, hexdigest)
  File "/home/rainer/.local/lib/python3.8/site-packages/creativeai/image/encoders/io.py", line 27, in download_to_file
    progressbar.DataSize(),
AttributeError: module 'progressbar' has no attribute 'DataSize'
alexjc commented 4 years ago

Can you check which version of progressbar2 was installed? https://progressbar-2.readthedocs.io/en/latest/_modules/progressbar/widgets.html#DataSize

I will look into this shortly...

alexjc commented 4 years ago

Likely it's an old version of progressbar (v1). It might be a question of doing: poetry install

Let me know if that fixes it!

rainerkohlberger commented 4 years ago

progressbar2 is installed (3.51.3) and poetry update + poetry install unfortunately didn’t do the trick. Still getting the same error.

rainerkohlberger commented 4 years ago

Might be related: I've edited setup-cuda.yml and removed 'he1778fa_0' and 'py3.8_cuda102_cudnn7_0' respectively. If I don't do that, this error occurs:

Solving environment: failed

ResolvePackageNotFound: 
  - python==3.8.3=he1778fa_0
  - pytorch==1.5.0=py3.8_cuda102_cudnn7_0
alexjc commented 4 years ago

No, the .yml file is unrelated. Did you install and run from a clean environment?

rainerkohlberger commented 4 years ago

yes, I've removed the environment, pulled the latest version and created the environment again, getting the same error message.

alexjc commented 4 years ago

This works with the automated builds, so I don't know why your installation is not working.

Try tying this pip list | grep progress and you should get the following (or above):

progressbar2       3.51.3
alexjc commented 4 years ago

I can't reproduce this, but a couple last things:

  1. There are also now notebooks in the #/examples/ folder, which you can run on Google Colab without any local installation required.
  2. I've updated setup-cpu.yml and setup-cuda.yml to remove the pinned version numbers when they are not necessary. (Both were tested just now.)