Embarcadero / P4D-Data-Sciences

A collection of lightweight Python wrappers based on Python4Delphi simplifying Data Sciences development with Delphi
MIT License
91 stars 21 forks source link

Torch issue (Mac) #7

Closed peardox closed 2 years ago

peardox commented 2 years ago

Hmm... I suppose this is a dependency pip issue?

Mac don't like https :(

===============================

log_event_api = True Downloading: "https://download.pytorch.org/models/vgg16-397923af.pth" to /Users/simon/.cache/torch/hub/checkpoints/vgg16-397923af.pth

Exception type is: URLError Traceback (most recent call last): File "", line 198, in delphi_train_test File "/Users/simon/Library/EmbedTest/pysrc/mlfuncts.py", line 287, in train raise e File "/Users/simon/Library/EmbedTest/pysrc/mlfuncts.py", line 141, in train vgg = Vgg16(requires_grad=False).to(device) File "/Users/simon/Library/EmbedTest/pysrc/vgg.py", line 11, in __init__ vgg_pretrained_features = models.vgg16(weights=VGG16_Weights.IMAGENET1K_V1).features File "/Users/simon/Library/EmbedTest/python/3.9/lib/python3.9/site-packages/torchvision/models/_utils.py", line 142, in wrapper return fn(*args, **kwargs) File "/Users/simon/Library/EmbedTest/python/3.9/lib/python3.9/site-packages/torchvision/models/_utils.py", line 228, in inner_wrapper return builder(*args, **kwargs) File "/Users/simon/Library/EmbedTest/python/3.9/lib/python3.9/site-packages/torchvision/models/vgg.py", line 410, in vgg16 return _vgg("D", False, weights, progress, **kwargs) File "/Users/simon/Library/EmbedTest/python/3.9/lib/python3.9/site-packages/torchvision/models/vgg.py", line 105, in _vgg model.load_state_dict(weights.get_state_dict(progress=progress)) File "/Users/simon/Library/EmbedTest/python/3.9/lib/python3.9/site-packages/torchvision/models/_api.py", line 63, in get_state_dict return load_state_dict_from_url(self.url, progress=progress) File "/Users/simon/Library/EmbedTest/python/3.9/lib/python3.9/site-packages/torch/hub.py", line 727, in load_state_dict_from_url download_url_to_file(url, cached_file, hash_prefix, progress=progress) File "/Users/simon/Library/EmbedTest/python/3.9/lib/python3.9/site-packages/torch/hub.py", line 593, in download_url_to_file u = urlopen(req) File "/Users/simon/Library/EmbedTest/python/3.9/lib/python3.9/urllib/request.py", line 214, in urlopen return opener.open(url, data, timeout) File "/Users/simon/Library/EmbedTest/python/3.9/lib/python3.9/urllib/request.py", line 517, in open response = self._open(req, data) File "/Users/simon/Library/EmbedTest/python/3.9/lib/python3.9/urllib/request.py", line 539, in _open return self._call_chain(self.handle_open, 'unknown', File "/Users/simon/Library/EmbedTest/python/3.9/lib/python3.9/urllib/request.py", line 494, in _call_chain result = func(*args) File "/Users/simon/Library/EmbedTest/python/3.9/lib/python3.9/urllib/request.py", line 1417, in unknown_open raise URLError('unknown url type: %s' % type) urllib.error.URLError:
peardox commented 2 years ago

This issue appears to be x86 specific as per https://towardsdatascience.com/gpu-acceleration-comes-to-pytorch-on-m1-macs-195c399efcc1

I'm gonna try an M1...