You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have downloaded the datasets and placed them in to the "data" folder, ensuring the names matched as per segmentation/header.py. However, in attempting to run segmentation/train.py for the JSRT dataset I get the following error:
[...]/segmentation$ python3 train.py
train.py
>> Generate network - v1.1
>> Load data
>>> Total # of trainset : 7
>>> Total # of valset : 1
>> Train Network - [1 epoch]
Traceback (most recent call last):
File "train.py", line 208, in <module>
main()
File "train.py", line 111, in main
for i, data in enumerate(trainloader, 0):
File "/[...]/anaconda3/envs/Oh_et_al_2020/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 345, in __next__
data = self._next_data()
File "/[...]/anaconda3/envs/Oh_et_al_2020/lib/python3.7/site-packages/torch/utils/data/dataloader.py", line 385, in _next_data
data = self._dataset_fetcher.fetch(index) # may raise StopIteration
File "/[...]/anaconda3/envs/Oh_et_al_2020/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/[...]/anaconda3/envs/Oh_et_al_2020/lib/python3.7/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp>
data = [self.dataset[idx] for idx in possibly_batched_index]
File "/[...]/Deep-Learning-COVID-19-on-CXR-using-Limited-Training-Data-Sets/segmentation/mydataset.py", line 60, in __getitem__
images = np.asarray(np.reshape(np.fromfile(self.images[index], dtype='>u2', sep="", ), (header.orig_height, header.orig_width)))
IsADirectoryError: [Errno 21] Is a directory: '../data/JSRT/Clinical_Information'
Clearly, you cannot use np.asarray() on a directory
I found where this issue is and did a rough workaround: MyTrainDataset.__init__() assumes any items returned by glob(image_path + /*) are image files and appends them to the file image list. Will do a pull request for this one.
The text was updated successfully, but these errors were encountered:
Hi,
I have downloaded the datasets and placed them in to the "data" folder, ensuring the names matched as per
segmentation/header.py
. However, in attempting to run segmentation/train.py for the JSRT dataset I get the following error:Clearly, you cannot use np.asarray() on a directory
I found where this issue is and did a rough workaround:
MyTrainDataset.__init__()
assumes any items returned byglob(image_path + /*)
are image files and appends them to the file image list. Will do a pull request for this one.The text was updated successfully, but these errors were encountered: