lsc-cnn icon indicating copy to clipboard operation
lsc-cnn copied to clipboard

Asking for author's help:train error

Open knightyxp opened this issue 3 years ago • 2 comments

when i train the lsc-cnn such error happens:

Traceback (most recent call last): File "/home/Linux-doc1/Yxp/lsc-cnn-master/data_reader.py", line 725, in _test_one_image predicted_maps_full_size UnboundLocalError: local variable 'predicted_maps_full_size' referenced before assignment

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/home/Linux-doc1/Yxp/lsc-cnn-master/main.py", line 1113, in # -- Train the model File "/home/Linux-doc1/Yxp/lsc-cnn-master/main.py", line 1053, in train network_functions=networkFunctions(), File "/home/Linux-doc1/Yxp/lsc-cnn-master/main.py", line 930, in train_networks

File "/home/Linux-doc1/Yxp/lsc-cnn-master/main.py", line 657, in test_lsccnn for e_idx, e_iter in enumerate(e): File "/home/Linux-doc1/Yxp/lsc-cnn-master/data_reader.py", line 281, in iterate_over_test_data pred_maps_full_size = self._test_one_image(crops, test_function) File "/home/Linux-doc1/Yxp/lsc-cnn-master/data_reader.py", line 727, in _test_one_image predicted_maps_full_size = [np.zeros((pmap.shape[1], crops[6].shape[0], crops[6].shape[1])) for pmap in results] File "/home/Linux-doc1/Yxp/lsc-cnn-master/data_reader.py", line 727, in predicted_maps_full_size = [np.zeros((pmap.shape[1], crops[6].shape[0], crops[6].shape[1])) for pmap in results] AttributeError: 'list' object has no attribute 'shape'

I do not make changes to the original code ,when I start to train or test ,this error always happens, I really want to know the reason why such bug would happen , please!

image

knightyxp avatar Sep 29 '20 14:09 knightyxp

@knightyxp +1

1691077362 avatar Nov 13 '21 03:11 1691077362

It could be an issue with the version of Python. When I switched to Python 3.6, the problem was resolved.

yueyusisi avatar Jul 14 '23 07:07 yueyusisi