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

AttributeError: 'FloatProgress' object has no attribute 'style #611

Closed
albertotono opened this issue Oct 30, 2020 · 5 comments
Closed

AttributeError: 'FloatProgress' object has no attribute 'style #611

albertotono opened this issue Oct 30, 2020 · 5 comments

Comments

@albertotono
Copy link

While running the demo

Downloading http://yann.lecun.com/exdb/mnist/train-images-idx3-ubyte.gz to mnist/MNIST/raw/train-images-idx3-ubyte.gz

Widget Javascript not detected.  It may not be installed or enabled properly.

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-13-0f2283fa5c18> in <module>
     42         writer.add_pr_curve('xoxo', np.random.randint(2, size=100), np.random.rand(100), n_iter)
     43 
---> 44 dataset = datasets.MNIST('mnist', train=False, download=True)
     45 images = dataset.test_data[:100].float()
     46 label = dataset.test_labels[:100]

/usr/lib/python3/dist-packages/torchvision/datasets/mnist.py in __init__(self, root, train, transform, target_transform, download)
     68 
     69         if download:
---> 70             self.download()
     71 
     72         if not self._check_exists():

/usr/lib/python3/dist-packages/torchvision/datasets/mnist.py in download(self)
    135         for url, md5 in self.resources:
    136             filename = url.rpartition('/')[2]
--> 137             download_and_extract_archive(url, download_root=self.raw_folder, filename=filename, md5=md5)
    138 
    139         # process and save as torch files

/usr/lib/python3/dist-packages/torchvision/datasets/utils.py in download_and_extract_archive(url, download_root, extract_root, filename, md5, remove_finished)
    233         filename = os.path.basename(url)
    234 
--> 235     download_url(url, download_root, filename, md5)
    236 
    237     archive = os.path.join(download_root, filename)

/usr/lib/python3/dist-packages/torchvision/datasets/utils.py in download_url(url, root, filename, md5)
     69             urllib.request.urlretrieve(
     70                 url, fpath,
---> 71                 reporthook=gen_bar_updater()
     72             )
     73         except (urllib.error.URLError, IOError) as e:

/usr/lib/python3/dist-packages/torchvision/datasets/utils.py in gen_bar_updater()
     12 
     13 def gen_bar_updater():
---> 14     pbar = tqdm(total=None)
     15 
     16     def bar_update(count, block_size, total_size):

~/.local/lib/python3.8/site-packages/tqdm/notebook.py in __init__(self, *args, **kwargs)
    224             self.fp, total, self.desc, self.ncols)
    225         self.sp = self.display
--> 226         self.colour = colour
    227 
    228         # Print initial bar state

~/.local/lib/python3.8/site-packages/tqdm/notebook.py in colour(self, bar_color)
    193     def colour(self, bar_color):
    194         if hasattr(self, 'container'):
--> 195             self.container.children[-2].style.bar_color = bar_color
    196 
    197     def __init__(self, *args, **kwargs):

AttributeError: 'FloatProgress' object has no attribute 'style
@xoxoxo13102020
Copy link

While running the demo

Downloading http://yann.lecun.com/exdb/mnist/train-images-idx3-ubyte.gz to mnist/MNIST/raw/train-images-idx3-ubyte.gz

Widget Javascript not detected.  It may not be installed or enabled properly.

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-13-0f2283fa5c18> in <module>
     42         writer.add_pr_curve('xoxo', np.random.randint(2, size=100), np.random.rand(100), n_iter)
     43 
---> 44 dataset = datasets.MNIST('mnist', train=False, download=True)
     45 images = dataset.test_data[:100].float()
     46 label = dataset.test_labels[:100]

/usr/lib/python3/dist-packages/torchvision/datasets/mnist.py in __init__(self, root, train, transform, target_transform, download)
     68 
     69         if download:
---> 70             self.download()
     71 
     72         if not self._check_exists():

/usr/lib/python3/dist-packages/torchvision/datasets/mnist.py in download(self)
    135         for url, md5 in self.resources:
    136             filename = url.rpartition('/')[2]
--> 137             download_and_extract_archive(url, download_root=self.raw_folder, filename=filename, md5=md5)
    138 
    139         # process and save as torch files

/usr/lib/python3/dist-packages/torchvision/datasets/utils.py in download_and_extract_archive(url, download_root, extract_root, filename, md5, remove_finished)
    233         filename = os.path.basename(url)
    234 
--> 235     download_url(url, download_root, filename, md5)
    236 
    237     archive = os.path.join(download_root, filename)

/usr/lib/python3/dist-packages/torchvision/datasets/utils.py in download_url(url, root, filename, md5)
     69             urllib.request.urlretrieve(
     70                 url, fpath,
---> 71                 reporthook=gen_bar_updater()
     72             )
     73         except (urllib.error.URLError, IOError) as e:

/usr/lib/python3/dist-packages/torchvision/datasets/utils.py in gen_bar_updater()
     12 
     13 def gen_bar_updater():
---> 14     pbar = tqdm(total=None)
     15 
     16     def bar_update(count, block_size, total_size):

~/.local/lib/python3.8/site-packages/tqdm/notebook.py in __init__(self, *args, **kwargs)
    224             self.fp, total, self.desc, self.ncols)
    225         self.sp = self.display
--> 226         self.colour = colour
    227 
    228         # Print initial bar state

~/.local/lib/python3.8/site-packages/tqdm/notebook.py in colour(self, bar_color)
    193     def colour(self, bar_color):
    194         if hasattr(self, 'container'):
--> 195             self.container.children[-2].style.bar_color = bar_color
    196 
    197     def __init__(self, *args, **kwargs):

AttributeError: 'FloatProgress' object has no attribute 'style

+1

@kevin-why
Copy link

+1

1 similar comment
@TecnologiaIntegrada
Copy link

+1

@lanpa
Copy link
Owner

lanpa commented Mar 13, 2021

I believe this is an URL issue.
pytorch/vision#1940
pytorch/vision#3544
Should be fixed automatically after new mirror location is added.

@lanpa
Copy link
Owner

lanpa commented Apr 2, 2021

Update to torchvision >= 0.9.1 and it should be ok.

@lanpa lanpa closed this as completed Apr 2, 2021
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

5 participants