p2irc / deepplantphenomics

Deep learning for plant phenotyping.
GNU General Public License v2.0
135 stars 46 forks source link

An error occurred while running pre-trained networks #9

Closed bursalihilal closed 5 years ago

bursalihilal commented 6 years ago

I tried with pre-trained examples from tools. However, i always get ` File "arabidopsis_strain_classifier_test.py", line 20, in y = dpp.tools.classify_arabidopsis_strain(images) ...

File "/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/tensorflow/python/training/saver.py", line 1745, in restore raise ValueError("Can't load save_path when it is None.") ValueError: Can't load save_path when it is None. `

My python version version is 3.6.5

jubbens commented 6 years ago

Did you download the network weights using git-lfs as it says in the readme.md?

Can you post the full error message?

stardust66 commented 6 years ago

@bursalihilal setup.py doesn't copy the pretrained weights when installing the package. You can manually copy the folder deepplantphenomics/network_states to where the library is installed. You can find out where it is by running

import deepplantphenomics as dpp
print(dpp.__file__)

@jubbens I think specifying the pretrained weights files in setup.py as data files will copy the files upon installing. https://docs.python.org/3.7/distutils/setupscript.html#installing-additional-files

jubbens commented 6 years ago

@stardust66 thanks for investigating this! Will test out the fix.

uday1994 commented 6 years ago

I tried to test "rosette_leaf_count_test.py" from the examples and I get the following error.

OutOfRangeError (see above for traceback): Read fewer bytes than requested [[Node: save/RestoreV2_11 = RestoreV2[dtypes=[DT_FLOAT], _device="/job:localhost/replica:0/task:0/device:CPU:0"](_arg_save/Const_0_0, save/RestoreV2_11/tensor_names, save/RestoreV2_11/shape_and_slices)]]

jubbens commented 6 years ago

@uday1994 it's likely that you didn't download the network weights with git-lfs.

Dinesh317 commented 6 years ago

How to download the network weights with git-lfs.

Dinesh317 commented 6 years ago

Performing leaf estimation...

ValueError Traceback (most recent call last)

in () 5 print('Performing leaf estimation...') 6 ----> 7 y = dpp.tools.predict_rosette_leaf_count(images) 8 /anaconda3/lib/python3.6/site-packages/deepplantphenomics/tools.py in predict_rosette_leaf_count(x, batch_size) 16 17 net = networks.rosetteLeafRegressor(batch_size=batch_size) ---> 18 predictions = net.forward_pass(x) 19 net.shut_down() 20 /anaconda3/lib/python3.6/site-packages/deepplantphenomics/networks.py in forward_pass(self, x) 126 127 def forward_pass(self, x): --> 128 y = self.model.forward_pass_with_file_inputs(x) 129 130 return y[:,0] /anaconda3/lib/python3.6/site-packages/deepplantphenomics/deepplantpheno.py in forward_pass_with_file_inputs(self, x) 1360 1361 if self.__load_from_saved: -> 1362 self.load_state() 1363 1364 self.__initialize_queue_runners() /anaconda3/lib/python3.6/site-packages/deepplantphenomics/deepplantpheno.py in load_state(self) 1266 with self.__graph.as_default(): 1267 saver = tf.train.Saver(tf.trainable_variables()) -> 1268 saver.restore(self.__session, tf.train.latest_checkpoint(self.__load_from_saved)) 1269 1270 self.__has_trained = True /anaconda3/lib/python3.6/site-packages/tensorflow/python/training/saver.py in restore(self, sess, save_path) 1794 return 1795 if save_path is None: -> 1796 raise ValueError("Can't load save_path when it is None.") 1797 logging.info("Restoring parameters from %s", save_path) 1798 if context.executing_eagerly(): ValueError: Can't load save_path when it is None.
jubbens commented 5 years ago

should be fixed in 092fa08