在代码中使用numpy的.load函数加载数据时,

x_train = np.load(path, allow_pickle=True).reshape(-1, 144, 144, 3)

出现:

ValueError: cannot reshape array of size 1769472000 into shape (144,144,3)

一种常见报错方式,可以是一个模板:

ValueError: cannot reshape array of size xxx into shape (xx, xx, x)

其中的一种解决方式是:

x_train = np.load(path, allow_pickle=True)#.reshape(-1, 144, 144, 3)

**即是将.reshape注释掉,希望给大家提供一种解决问题的方法。**感觉程序是一个顽皮的小孩子,有时候自己都不老实。这次错误就是以前可以运行的代码,隔一段时间再运行,就行不通了。程序,隔一段时间,看着就不熟悉了,你不和他玩,好像自己和自己玩玩似的!以后,还是常顾常新呀!!!!

Logo

北京人形旗下天工造物具身智能开源社区,聚焦具身天工与慧思开物两大平台

更多推荐