Closed miloy-ajmera closed 6 years ago
@Miloy03 Which script are you currently working with?
@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!
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".
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?
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.
Sir, I have trained the cnn model. How can i test the images and get the results?
@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
Sir but do you have a script just to test the images and predict the results?
@Miloy03 I do not; you'll have to download the images & predict on them separately.
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
Sir , Can you help me out with the commands to run after running the conversion script please?