Open calm-focus opened 6 years ago
For class ImageDataset(Dataset), there is no argument 'study_level' in "def init(self, df, transform=None):"
Hey @Zli1893 , just remove the study_level
arg from image_datasets = {x: ImageDataset(data[x], transform=data_transforms[x], study_level=study_level) for x in data_cat}
line
I've fixed the issue, you can see updated code here: https://github.com/pyaf/DenseNet-MURA-PyTorch/blob/master/pipeline.py
Let me know if you still face any error.
@pyaf I fix the above issue, but there is another error.
File "main.py", line 43, in
Traceback (most recent call last):
File "main.py", line 51, in
do some debugging, let me know the cause.
Hey, did you find the bug?
@pyaf Sorry, I have not found the bug yet. I still got the same error. Did you run it successfully?
@Zli1893 you may try adding preds = preds.view(-1) after line 50 and after line 101 in train.py and them fixing lines 53, 54: epoch_loss = running_loss.item() / dataset_sizes[phase] epoch_acc = running_corrects.item() / dataset_sizes[phase] and lines 105, 106: loss = running_loss.item() / dataset_sizes[phase] acc = running_corrects.item() / dataset_sizes[phase] otherwise accuracy will will not be calculated
Hi. I only can download MURA-v1.1 and I have an error when training
image = pil_loader(study_path + 'image%s.png' % (i+1))
File "/home/john/anaconda3/lib/python3.6/site-packages/torchvision/datasets/folder.py", line 128, in pil_loader
with open(path, 'rb') as f:
FileNotFoundError: [Errno 2] No such file or directory: 'MURA-v1.1/train/XR_WRIST/patient07840/study2_negative/image4.png'
@John1231983 Try checking out the path of your dataset. try giving absolute path instead of relative one. That may fix the issue.
Hi. Because i am using mura 1.1 so some files are missing comparison with mura 1.0. I guess problem is that image = pil_loader(study_path + 'image%s.png' % (i+1))
. I ran after 100 iters and it has that error
look into utils.py file, modify the functions accordingly.
There are 4 hidden files in MURA 1.1 for patient07840, which are counted towards the expected number of file in the folder, but do not follow the expected pattern (and are not valid). The easiest fix is to delete these files:
MURA-v1.1/train/XR_WRIST/patient07840/study1_negative/._image1.png
MURA-v1.1/train/XR_WRIST/patient07840/study2_negative/._image3.png
MURA-v1.1/train/XR_WRIST/patient07840/study2_negative/._image1.png
MURA-v1.1/train/XR_WRIST/patient07840/study2_negative/._image2.png
@Zli1893 Hey could you debug this? I got the exact same error for a batch_size greater than 1. I have written my own collate function. However that doesn't seem to be the problem.
File "main.py", line 16, in
dataloaders = get_dataloaders(study_data, batch_size=1)
File "/home/zli/PycharmProjects/DenseNet-MURA-PyTorch/pipeline.py", line 79, in get_dataloaders
image_datasets = {x: ImageDataset(data[x], transform=data_transforms[x], study_level=study_level) for x in data_cat}
File "/home/zli/PycharmProjects/DenseNet-MURA-PyTorch/pipeline.py", line 79, in
image_datasets = {x: ImageDataset(data[x], transform=data_transforms[x], study_level=study_level) for x in data_cat}
TypeError: init() got an unexpected keyword argument 'study_level'
When I run python main.py, I got the above error. Do you know how to fix it?