AttributeError: 'Model' object has no attribute 'name'

Traceback (most recent call last):

  File "<ipython-input-15-7fa9988e38ef>", line 1, in <module>
    runfile('E:/experiment/paper1/train.py', wdir='E:/experiment/paper1')

  File "C:\Users\admin\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 710, in runfile
    execfile(filename, namespace)

  File "C:\Users\admin\Anaconda3\lib\site-packages\spyder\utils\site\sitecustomize.py", line 101, in execfile
    exec(compile(f.read(), filename, 'exec'), namespace)

  File "E:/experiment/paper1/train.py", line 44, in <module>
    model=hsi_net.FDSSC()

  File "E:\experiment\paper1\hsi_net.py", line 115, in FDSSC
    model=Model([input_data],pred)

  File "C:\Users\admin\Anaconda3\lib\site-packages\keras\legacy\interfaces.py", line 91, in wrapper
    return func(*args, **kwargs)

  File "C:\Users\admin\Anaconda3\lib\site-packages\keras\engine\network.py", line 91, in __init__
    self._init_graph_network(*args, **kwargs)

  File "C:\Users\admin\Anaconda3\lib\site-packages\keras\engine\network.py", line 183, in _init_graph_network
    'The tensor that caused the issue was: ' +

AttributeError: 'Model' object has no attribute 'name'

Enter hsi_net.py files found FDSSC function.

Red circle painted input_data should be input to the model, but due to reshape when naming variables problems, leading input_data become another variable, so the runtime will receive an error.

 

Guess you like

Origin www.cnblogs.com/wangtianning1223/p/10929228.html