gregwchase / eyenet

Identifying diabetic retinopathy using convolutional neural networks
https://www.youtube.com/watch?v=pMGLFlgqxuY
MIT License
195 stars 76 forks source link

Next Steps #2

Closed miloy-ajmera closed 6 years ago

miloy-ajmera commented 6 years ago

Sir , Can you help me out with the commands to run after running the conversion script please?

gregwchase commented 6 years ago

@Miloy03 Which script are you currently working with?

miloy-ajmera commented 6 years ago

@gregwchase I am using your code. I have finished preprocessing scripts. Now I need the commands to train the neural network and get the results. Can you help me with this sir ? My email id is miloyajmera.12@gmail.com. Thank You!

gregwchase commented 6 years ago

The next script you'll want to run is "cnn.py", which is for binary classification. If you want to train across all categories, run "cnn_class.py".

miloy-ajmera commented 6 years ago

Sir , I tried that but i got a file numpy array as X_train.npy . The file cnn.py needs X_train_256_v2.npy ,Is this the same as X_train.npy?

gregwchase commented 6 years ago

Yes! I had two different versions, hence the naming. X_train is the same as X_train_256_v2.npy. Just change the script, and you should be good to go.

miloy-ajmera commented 6 years ago

Sir, I have trained the cnn model. How can i test the images and get the results?

gregwchase commented 6 years ago

@Miloy03 You can download the test images below, and use them to make a prediction on Kaggle! Be aware you're fitting to a holdout set, so your mileage may vary.

https://www.kaggle.com/c/diabetic-retinopathy-detection/data

miloy-ajmera commented 6 years ago

Sir but do you have a script just to test the images and predict the results?

gregwchase commented 6 years ago

@Miloy03 I do not; you'll have to download the images & predict on them separately.

miloy-ajmera commented 6 years ago

Sir, Can you help me out with this error i get while saving the model in cnn.py. I am just trying to run this script for few images. ...... python cnn.py /home/miloy/anaconda2/envs/tensorflow/lib/python3.6/site-packages/h5py/init.py:36: FutureWarning: Conversion of the second argument of issubdtype from float to np.floating is deprecated. In future, it will be treated as np.float64 == np.dtype(float).type. from ._conv import register_converters as _register_converters Using TensorFlow backend. /home/miloy/anaconda2/envs/tensorflow/lib/python3.6/importlib/_bootstrap.py:219: RuntimeWarning: compiletime version 3.5 of module 'tensorflow.python.framework.fast_tensor_util' does not match runtime version 3.6 return f(*args, **kwds) Splitting data into test/ train datasets Reshaping Data X_train Shape: (73, 256, 256, 3) X_test Shape: (19, 256, 256, 3) Normalizing Data y_train Shape: (73, 2) y_test Shape: (19, 2) Training Model Model flattened out to: (None, 438048) Train on 58 samples, validate on 15 samples Epoch 1/3 58/58 [==============================] - 16s 280ms/step - loss: 3.3556 - acc: 0.5000 - val_loss: 3.7628 - val_acc: 0.4667 Epoch 2/3 58/58 [==============================] - 13s 217ms/step - loss: 3.0098 - acc: 0.5345 - val_loss: 2.9008 - val_acc: 0.4667 Epoch 3/3 58/58 [==============================] - 13s 224ms/step - loss: 2.1851 - acc: 0.5345 - val_loss: 2.0947 - val_acc: 0.4667 Predicting Test score: 1.8627175092697144 Test accuracy: 0.5263158082962036 Precision: 0.5263157894736842 Recall: 1.0 Saving Model Traceback (most recent call last): File "cnn.py", line 195, in save_model(model=model, score=recall, model_name="DR_Two_Classes") File "cnn.py", line 128, in save_model model.save("../models/" + model_name + "recall" + str(round(score, 4)) + ".h5") File "/home/miloy/anaconda2/envs/tensorflow/lib/python3.6/site-packages/keras/engine/topology.py", line 2576, in save save_model(self, filepath, overwrite, include_optimizer) File "/home/miloy/anaconda2/envs/tensorflow/lib/python3.6/site-packages/keras/models.py", line 111, in save_model 'config': model.get_config() File "/home/miloy/anaconda2/envs/tensorflow/lib/python3.6/site-packages/keras/engine/topology.py", line 2417, in get_config return copy.deepcopy(config) File "/home/miloy/anaconda2/envs/tensorflow/lib/python3.6/copy.py", line 150, in deepcopy y = copier(x, memo) File "/home/miloy/anaconda2/envs/tensorflow/lib/python3.6/copy.py", line 240, in _deepcopy_dict y[deepcopy(key, memo)] = deepcopy(value, memo) File "/home/miloy/anaconda2/envs/tensorflow/lib/python3.6/copy.py", line 150, in deepcopy y = copier(x, memo) File "/home/miloy/anaconda2/envs/tensorflow/lib/python3.6/copy.py", line 215, in _deepcopy_list append(deepcopy(a, memo)) File "/home/miloy/anaconda2/envs/tensorflow/lib/python3.6/copy.py", line 150, in deepcopy y = copier(x, memo) File "/home/miloy/anaconda2/envs/tensorflow/lib/python3.6/copy.py", line 240, in _deepcopy_dict y[deepcopy(key, memo)] = deepcopy(value, memo) File "/home/miloy/anaconda2/envs/tensorflow/lib/python3.6/copy.py", line 150, in deepcopy y = copier(x, memo) File "/home/miloy/anaconda2/envs/tensorflow/lib/python3.6/copy.py", line 240, in _deepcopy_dict y[deepcopy(key, memo)] = deepcopy(value, memo) File "/home/miloy/anaconda2/envs/tensorflow/lib/python3.6/copy.py", line 150, in deepcopy y = copier(x, memo) File "/home/miloy/anaconda2/envs/tensorflow/lib/python3.6/copy.py", line 220, in _deepcopy_tuple y = [deepcopy(a, memo) for a in x] File "/home/miloy/anaconda2/envs/tensorflow/lib/python3.6/copy.py", line 220, in y = [deepcopy(a, memo) for a in x] File "/home/miloy/anaconda2/envs/tensorflow/lib/python3.6/copy.py", line 150, in deepcopy y = copier(x, memo) File "/home/miloy/anaconda2/envs/tensorflow/lib/python3.6/copy.py", line 220, in _deepcopy_tuple y = [deepcopy(a, memo) for a in x] File "/home/miloy/anaconda2/envs/tensorflow/lib/python3.6/copy.py", line 220, in y = [deepcopy(a, memo) for a in x] File "/home/miloy/anaconda2/envs/tensorflow/lib/python3.6/copy.py", line 169, in deepcopy rv = reductor(4) TypeError: can't pickle module objects