AttributeError: 'FloatProgress' object has no attribute 'style
albertotono opened this issue · 5 comments
albertotono commented
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 commented
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 commented
+1
TecnologiaIntegrada commented
+1
lanpa commented
I believe this is an URL issue.
pytorch/vision#1940
pytorch/vision#3544
Should be fixed automatically after new mirror location is added.
lanpa commented
Update to torchvision >= 0.9.1 and it should be ok.