-------Loading CLIP with vision encoder ViT-B/32 -------
-------Training started-------
Traceback (most recent call last):
File "C:/Users/fhdu/PycharmProjects/PubMedCLIP/main/main.py", line 51, in <module>
train(cfg, train_loader, val_loader, device)
File "C:\Users\fhdu\PycharmProjects\PubMedCLIP\main\train.py", line 65, in train
for i, (image, caption) in enumerate(train_loader):
File "E:\SoftwareFile\Anaconda3\envs\med_vqa\lib\site-packages\torch\utils\data\dataloader.py", line 521, in __next__
data = self._next_data()
File "E:\SoftwareFile\Anaconda3\envs\med_vqa\lib\site-packages\torch\utils\data\dataloader.py", line 561, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "E:\SoftwareFile\Anaconda3\envs\med_vqa\lib\site-packages\torch\utils\data\_utils\fetch.py", line 49, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "E:\SoftwareFile\Anaconda3\envs\med_vqa\lib\site-packages\torch\utils\data\_utils\fetch.py", line 49, in <listcomp>
data = [self.dataset[idx] for idx in possibly_batched_index]
File "C:\Users\fhdu\PycharmProjects\PubMedCLIP\lib\dataset\ROCOdataset.py", line 80, in __getitem__
**image = self._load_image(index)**
File "C:\Users\fhdu\PycharmProjects\PubMedCLIP\lib\dataset\ROCOdataset.py", line 70, in _load_image
**image = read_image(path, mode=ImageReadMode.RGB)**
File "E:\SoftwareFile\Anaconda3\envs\med_vqa\lib\site-packages\torchvision\io\image.py", line 222, in read_image
data = read_file(path)
File "E:\SoftwareFile\Anaconda3\envs\med_vqa\lib\site-packages\torchvision\io\image.py", line 42, in read_file
data = torch.ops.image.read_file(path)
File "E:\SoftwareFile\Anaconda3\envs\med_vqa\lib\site-packages\torch\_ops.py", line 63, in __getattr__
op = torch._C._jit_get_operation(qualified_op_name)
RuntimeError: No such operator image::read_file
Not sure the wrong version of torch leads to this issue? my version:
torch 1.10.0 , torchvision 0.11.1
Looking forward to your answer, thanks in advance.
TorchVision depends on C+±implemented modules to provide JITed operations. Apparently, this has not been/canbot be loaded.
Do you get a warning about that?
Yesterday I met this error when running Tensor transforms and JIT — Torchvision main documentation, that time is midnight, so I decide to retry it tomorrow. Because I doubt I mixed two versions of pytorch, today I uninstall pytorch(by pip uninstall pytorch and conda uninstall pytorch) and reintall it(by pip install torch==1.10.1+cu102 torchvision==0.11.2+cu102 torchaudio==0.10.1 -f https://download.pytorch.org/whl/torch_stable.html), this error disappear… Now my env infos are:
the torchvision upgrade from torchvision==0.10.0+cu102 to torchvision==0.11.2+cu102, I am not sure it is the issue of low version of torchvision or the issue of mixing two versions of pytorch
I am relatively new to google colab. How do you uninstall PyTorch from colab. I am facing a similar error (starting today, it was fine until yesterday!) while running my NN implementation on colab. To be exact here is the error message:
RuntimeError Traceback (most recent call last)
/usr/local/lib/python3.7/dist-packages/torch/_ops.py in __getattr__(self, op_name)
197 try:
--> 198 op, overload_names = torch._C._jit_get_operation(qualified_op_name)
199 except RuntimeError as e:
RuntimeError: No such operator image::read_file
The above exception was the direct cause of the following exception:
AttributeError Traceback (most recent call last)
It seems the origin is an object called ‘_OpNamespace’ which apparently does not have the read_file attribute.