arpanmangal / covidaid Goto Github PK
View Code? Open in Web Editor NEWCOVID-19 Detection Using Chest X-Ray
Home Page: http://arxiv.org/abs/2004.09803
COVID-19 Detection Using Chest X-Ray
Home Page: http://arxiv.org/abs/2004.09803
Traceback (most recent call last):
File "/content/CovidAID/tools/transfer.py", line 32, in
chexnet_model = load_weights(chexnet_model_checkpoint)
File "/content/CovidAID/tools/transfer.py", line 22, in load_weights
model = torch.load(checkpoint_pth)
File "/usr/local/lib/python3.7/dist-packages/torch/serialization.py", line 581, in load
with _open_file_like(f, 'rb') as opened_file:
File "/usr/local/lib/python3.7/dist-packages/torch/serialization.py", line 230, in _open_file_like
return _open_file(name_or_buffer, mode)
File "/usr/local/lib/python3.7/dist-packages/torch/serialization.py", line 211, in init
super(_open_file, self).init(open(name, mode))
FileNotFoundError: [Errno 2] No such file or directory: './data/CheXNet_model.pth.tar'
what should be the model path?
Can we use covidaid for binary classification?(normal and covid)
I followed all the commands provided in Getting_Started.md file. Previously i installed all the dependent modules mentioned in install.md file. When i run the trainer.py with necessary arguments, the following error occurs.
Distributed training OFF
Loading model from ../models/CovidAID_transfered.pth.tar
Freezing feature layers
100%|██████████| 115/115.0 [02:07<00:00, 1.11s/it]
0%| | 0/10.0 [00:00<?, ?it/s]
Traceback (most recent call last):
File "/home/sabuj/PycharmProjects/CovidAid/tools/trainer.py", line 438, in
start_epoch=args.start, save_path=args.save, freeze_feature_layers=args.freeze)
File "/home/sabuj/PycharmProjects/CovidAid/tools/trainer.py", line 147, in train
for i, (inputs, target) in tqdm(enumerate(val_loader), total=len(val_dataset)/BATCH_SIZE):
File "/home/sabuj/PycharmProjects/CovidAid/venv/lib/python3.6/site-packages/tqdm/std.py", line 1178, in iter
for obj in iterable:
File "/home/sabuj/PycharmProjects/CovidAid/venv/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 210, in next
return self._process_next_batch(batch)
File "/home/sabuj/PycharmProjects/CovidAid/venv/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 230, in _process_next_batch
raise batch.exc_type(batch.exc_msg)
IndexError: Traceback (most recent call last):
File "/home/sabuj/PycharmProjects/CovidAid/venv/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 42, in _worker_loop
samples = collate_fn([dataset[i] for i in batch_indices])
File "/home/sabuj/PycharmProjects/CovidAid/venv/lib/python3.6/site-packages/torch/utils/data/dataloader.py", line 42, in
samples = collate_fn([dataset[i] for i in batch_indices])
File "/home/sabuj/PycharmProjects/CovidAid/tools/read_data.py", line 157, in getitem
image_name = random.choice(self.image_names[class_idx])
File "/usr/lib/python3.6/random.py", line 260, in choice
raise IndexError('Cannot choose from an empty sequence') from None
IndexError: Cannot choose from an empty sequence
Can anyone please suggest what might be causing this issue?
Hi, I was just trying to replicate the ROC's you presented in your paper using the test_set you described in prepare_data.py. I'm executing trainer.py with your proposed settings:
"--mode","test",
"--checkpoint","path_to_CovidAID_transfered.pth.tar",
"--cm_path","path_to_plots/cm_best",
"--roc_path","path_to_plots/roc_best",
"--combine_pneumonia"
I see that default batch size is 64 which brings the total inputs.shape to [640,3,224,224] (default 10 crops). This doesn't fit on GPU's memory. I was wondering what other settings you used to validate on the test set? E.g.: did you added a specific batch size "--bs","1" or did you use the distributed processing - if so can you explain to me how to use this in your code?
Thanks!
AssertionError Traceback (most recent call last)
~\CovidAID-master\tools\transfer.py in
44 #print (len(c_keys.difference(t_keys)))
45 #print (len(t_keys.difference(c_keys)))
---> 46 assert len(c_keys.difference(t_keys)) == 0
47 assert len(t_keys.difference(c_keys)) == 0
48
AssertionError:
python3 tools/transfer.py --combine_pneumonia
Traceback (most recent call last):
File "tools/transfer.py", line 45, in
assert len(c_keys.difference(t_keys)) == 0
AssertionError
I am using google colab to run the code. Whenever I am running the code using "!python trainer.py", it is showing this error.
usage: trainer.py [-h] [--local_rank LOCAL_RANK] --mode {train,test,f1}
--checkpoint CHECKPOINT [--combine_pneumonia] [--save SAVE]
[--start START] [--lr LR] [--freeze] [--bs BS]
[--cm_path CM_PATH] [--roc_path ROC_PATH]
trainer.py: error: the following arguments are required: --checkpoint
An exception has occurred, use %tb to see the full traceback.
SystemExit: 2
Can you please help me with this?
Hey, after making your model torch>1.0 compatible I got the RISE "explainer" predictions for the covid-19 file "4-x-day1.jpg" twice. The predictions are the same:
but the heatmaps produced by RISE look totally different:
Does the same happen to your torch<1.0 model? If not, do you know what could be the issue?
Present code requires pytorch0.3
and CUDA<=8.0
. The code needs to be updated to support pytorch>1.0
. The main reason for using pytorch0.3
is compatibility with trained CheXNet model.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.