我正在做一个有关自动驾驶汽车的项目(使用Udacity开源模拟器)。我一直在尝试使用Google Colab,但是如果我在PC上运行完全相同的代码,则会遇到很多错误,而这些错误是我不会遇到的。我猜想这都与上传数据的方式有关,所以我以许多不同的方式重复了该过程,但是我似乎无法弄清楚。
这是参考代码:https://colab.research.google.com/drive/123Q-1e8Csl6xYw_DfVTejtw0oozUjj7s?usp=sharing(这次我以与他相同的方式获取数据:https://colab.research.google.com/drive/1W5I8NYsavde4iy-1uiztNKwwYw7_Pfs_)。
无论如何,您会看到我收到此错误:Error when checking input: expected cropping2d_9_input to have 4 dimensions, but got array with shape (64, 64, 1)
我在Pycharm上没有获得完全相同的代码。知道为什么吗?
x_train = x_train.reshape(x_train.shape[0], 64, 64, 1)
x_test = x_test.reshape(x_test.shape[0], 64, 64, 1)