AttributeError: module ‘numpy‘ has no attribute ‘object‘

我的这个是在tensorboard调用numpy的一些组件然后导致的出错。
尝试过升级numpy的版本但是没有奏效。
后面升级了tensorboard版本就可以了。

更新:升级tensorboard 会导致其他问题,所以上面的方法不可行。
这个问题的根源是tensorboard 和numpy的版本不一致。
我的项目要求tensorboard为2.5.0,网上查了一下,兼容的numpy可以是1.18.5。
然后这个numpy跟我之前安装好的matplotlib版本不兼容,
所以我把原来的matplotlib卸了,
重新安装了3.2.2 。

更新:
如果用pip uninstall 可以能会有些没删干净,
比如删numpy时,numpy folder 没删掉,
需要手动删。
当numpy, tensorboard, matplotlib都删了并且人工确认删干净了,
就:

pip install numpy==1.18.5 matplotlib==3.2.2 tensorboard==2.5.0 --target=install_target_dir

文章出处登录后可见!

已经登录?立即刷新

共计人评分,平均

到目前为止还没有投票!成为第一位评论此文章。

(0)
xiaoxingxing的头像xiaoxingxing管理团队
上一篇 2023年3月5日 下午6:37
下一篇 2023年3月5日

相关推荐