-
Notifications
You must be signed in to change notification settings - Fork 27
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
FileNotFoundError: Caught FileNotFoundError in DataLoader worker process 0. #9
Comments
Hello @Swagzzy4 , Mmm, this is weird. I assume you have here https://github.com/ExplainableML/czsl/blob/main/flags.py#L3 In case it is, could you try to replace it with: |
I have noticed downloaded name of reps in downloaded datasets are different, they do not include "_" in their names rather include a space i.e "ripe_coffee" directory in my downloaded mit-states dataset is "ripe coffee". If you are running compcos configuration then problem for me was fixed by following changes.
However if you are running cge configuration, problem for me was fixed by changing the call function at line https://github.com/ExplainableML/czsl/blob/main/data/dataset.py#L24 by following function.
|
Thank you @gulzainali98 for providing a fix for this issue. We will inspect it and integrate your fix into the code. |
when i run the train.py with mit.yml ,here is the error:
Traceback (most recent call last):
File "train.py", line 233, in
main()
File "train.py", line 100, in main
train(epoch, image_extractor, model, trainloader, optimizer, writer)
File "train.py", line 122, in train_normal
for idx, data in tqdm(enumerate(trainloader), total=len(trainloader), desc = 'Training'):
File "/home/idea/anaconda3/envs/czsl/lib/python3.8/site-packages/tqdm/std.py", line 1166, in iter
for obj in iterable:
File "/home/idea/anaconda3/envs/czsl/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 435, in next
data = self._next_data()
File "/home/idea/anaconda3/envs/czsl/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1085, in _next_data
return self._process_data(data)
File "/home/idea/anaconda3/envs/czsl/lib/python3.8/site-packages/torch/utils/data/dataloader.py", line 1111, in _process_data
data.reraise()
File "/home/idea/anaconda3/envs/czsl/lib/python3.8/site-packages/torch/_utils.py", line 428, in reraise
raise self.exc_type(msg)
FileNotFoundError: Caught FileNotFoundError in DataLoader worker process 0.
Original Traceback (most recent call last):
File "/home/idea/anaconda3/envs/czsl/lib/python3.8/site-packages/torch/utils/data/_utils/worker.py", line 198, in _worker_loop
data = fetcher.fetch(index)
File "/home/idea/anaconda3/envs/czsl/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/idea/anaconda3/envs/czsl/lib/python3.8/site-packages/torch/utils/data/_utils/fetch.py", line 44, in
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/home/idea/zzy/czsl/data/dataset.py", line 405, in getitem
img = self.loader(image)
File "/home/idea/zzy/czsl/data/dataset.py", line 25, in call
img = Image.open(ospj(self.root_dir,img)).convert('RGB') #We don't want alpha
File "/home/idea/anaconda3/envs/czsl/lib/python3.8/site-packages/PIL/Image.py", line 2904, in open
fp = builtins.open(filename, "rb")
FileNotFoundError: [Errno 2] No such file or directory: 'DATA_ROOT/mit-states/images/ripe_coffee/IMG_3474.jpg'
but when I run with the utzappos dataset, there are no errors!
I have not idea how to fix this error. IMG_3474.jpg is really an existing file in "DATA_ROOT/mit-states/images/ripe_coffee". How can I fix that error
The text was updated successfully, but these errors were encountered: