Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asking for author's help:train error #28

Open
knightyxp opened this issue Sep 29, 2020 · 2 comments
Open

Asking for author's help:train error #28

knightyxp opened this issue Sep 29, 2020 · 2 comments

Comments

@knightyxp
Copy link

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

@1691077362
Copy link

@knightyxp +1

@yueyusisi
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants