成功解决AttributeError: module ‘keras‘ has no attribute ‘utils‘

代码运行报错如下:

成功解决AttributeError: module ‘keras‘ has no attribute ‘utils‘_第1张图片

 问题:module 'keras' has no attribute 'utils'

解决方法:

原有代码引入方式:

更改后:

 除去此类报错,有时如下引用:

成功解决AttributeError: module ‘keras‘ has no attribute ‘utils‘_第2张图片

会报出很多错误,而且从keras中import后面的引入模块会被标红,具体原因我也没找到,但是有一个比较通用的解决方法:

成功解决AttributeError: module ‘keras‘ has no attribute ‘utils‘_第3张图片

通过该方法以上问题均可以被解决,亲测有效。 

 

 

你可能感兴趣的:(keras,人工智能,python)