zoukankan      html  css  js  c++  java
  • 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:UsersadminAnaconda3libsite-packagesspyderutilssitesitecustomize.py", line 710, in runfile
        execfile(filename, namespace)
    
      File "C:UsersadminAnaconda3libsite-packagesspyderutilssitesitecustomize.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:experimentpaper1hsi_net.py", line 115, in FDSSC
        model=Model([input_data],pred)
    
      File "C:UsersadminAnaconda3libsite-packageskeraslegacyinterfaces.py", line 91, in wrapper
        return func(*args, **kwargs)
    
      File "C:UsersadminAnaconda3libsite-packageskerasengine
    etwork.py", line 91, in __init__
        self._init_graph_network(*args, **kwargs)
    
      File "C:UsersadminAnaconda3libsite-packageskerasengine
    etwork.py", line 183, in _init_graph_network
        'The tensor that caused the issue was: ' +
    
    AttributeError: 'Model' object has no attribute 'name'

    进入hsi_net.py文件找到FDSSC函数。

    红圈画的input_data应该是模型的输入,但是由于reshape时变量命名的问题,导致input_data变成了别的变量,所以在运行时会出现如下错误。

  • 相关阅读:
    gil
    异步
    字符串 最长回文字串
    字符串 最长公共前缀
    数组 合并区间
    python 排序
    2021.9.3 阿里笔试AK贴
    SIP协议详解
    fiddler抓包各字段的含义
    常见的HTTP状态码列表
  • 原文地址:https://www.cnblogs.com/wangtianning1223/p/10929228.html
Copyright © 2011-2022 走看看