saurabheights / DiabeticRetinopathyDetection

Deep Learning Project on Diabetic Retinopathy Detection - TUM Team ID 47
GNU General Public License v3.0
21 stars 8 forks source link

No positive labels for row {i} #4

Closed tannaz-k closed 6 years ago

tannaz-k commented 6 years ago

Hi I download DiabeticRetinopathyDetection code, run setup.h, download kaggle dataset as you said and then run the preprocess.py.All done successfully. I also rename the configuration.py and edit the parameters. But when I run train_model.py, the following error occured:

Traceback (most recent call last): File "Desktop/DiabeticRetinopathyDetection-master2/src/train_model.py", line 43, in <module> pin_memory=True) File "/home/linux/Desktop/DiabeticRetinopathyDetection-master2/src/data_loading.py", line 181, in get_train_valid_loader train_idx = label_balancer.rebalance_categorical_train_idxs_evenly() File "/home/linux/Desktop/DiabeticRetinopathyDetection-master2/src/data_loading.py", line 99, in rebalance_categorical_train_idxs_evenly row_pos, row_n = self._get_row_counts(num_classes) File "/home/linux/Desktop/DiabeticRetinopathyDetection-master2/src/data_loading.py", line 67, in _get_row_counts raise ValueError(f"No positive labels for row {i}.") ValueError: No positive labels for row 3. I would appreciate your help :( , Thanks in advanced

saurabheights commented 6 years ago

Hi, downloading the whole dataset is not possible for me right now. Could you upload your configuration file? I can try running it on sample dataset file and see if the issue persists.

saurabheights commented 6 years ago

P.S. In case you are running on sample data of 10 images, make sure out of those 10 images, there is at least one image for each label 0 to 4.

tannaz-k commented 6 years ago

Hi I run the code on the sample data that you've uploaded. There's no image for class 3, I suppose. Here's my config file:

configuration.zip And here's my sample data:

[sample.zip] (https://github.com/saurabheights/DiabeticRetinopathyDetection/files/2402007/sample.zip)

tannaz-k commented 6 years ago

P. S. I've added one image for class 3 in the train dataset and this error occured:

Traceback (most recent call last): File "Desktop/DiabeticRetinopathyDetection-master2/src/train_model.py", line 52, in <module> model = model_params['model'](**model_params['model_kwargs'], default_lr=optimizer_params['lr']) TypeError: __init__() got an unexpected keyword argument 'default_lr'

saurabheights commented 6 years ago

Hi, I will look into it as soon as possible but currently tied in office work. If you want, you can try changing the learning params and rebalancing strategy(set to None) till I reply.

tannaz-k commented 6 years ago

Hi, thank you for your prompt reply. I've done what you said, but there's still an error. I changed the learning params and set rebalancing strategy to None as u said. Am I doing sth wrong? Or it's a bug in the code?

Traceback (most recent call last): File "Desktop/DiabeticRetinopathyDetection-master2/src/train_model.py", line 52, in <module> model = model_params['model'](**model_params['model_kwargs'], default_lr=optimizer_params['lr']) TypeError: __init__() got an unexpected keyword argument 'default_lr'

omsh commented 6 years ago

Hi, Use the transfer learning configuration file (here). You can also change the 'model' to DRNet in your configuration.

tannaz-k commented 6 years ago

Hi, Thanks a lot, I will try it and tell you the result.

tannaz-k commented 6 years ago

Hi, I changed my config file to the file that you've told and run it on kaggle dataset. I also change batch size to 10. Then I execute sudo command sudo python3 Desktop/DiabeticRetinopathyDetection-master2/src/train_model.py.and the training has finished till epoch 50. At the end of epoch 50, this error has occured:

Traceback (most recent call last):
  File "Desktop/DiabeticRetinopathyDetection-master2/src/train_model.py", line 95, in <module>
    predictions, image_names = model_trainer.predict_on_test()
  File "/home/linux/Desktop/DiabeticRetinopathyDetection-master2/src/trainer.py", line 178, in predict_on_test
    bar = progressbar.ProgressBar(max_value=len(self.test_dataset_loader))
TypeError: __init__() got an unexpected keyword argument 'max_value'
saurabheights commented 6 years ago

Dear, please try to google these issues first. It will save both your and my time. Progressbar is just to display how much of work is done, the same way apt-get shows a horizontal bar. The second result of the error shows a possible solution:- https://github.com/ikostrikov/TensorFlow-VAE-GAN-DRAW/issues/8 - just change max_value maxval.

You can also check the code where error happened and quick fix it.

Second, please create a new issue page for different problem faced.

P.S. - I will fix these issue in the repo, as soon as I resolve my current tasks.

mrzhangzizhen123 commented 5 years ago

Hi, Use the transfer learning configuration file (here). You can also change the 'model' to DRNet in your configuration.

Could you explain the configuration details in detail?I made a mistake according to your configuration.

mrzhangzizhen123 commented 5 years ago

@omsh Could you explain the configuration details in detail?I made a mistake according to your configuration.

mrzhangzizhen123 commented 5 years ago

@omsh You can provide your bug-free code

mrzhangzizhen123 commented 5 years ago

@tannaz-k can you provide your bug-free code?