我正在做喀拉拉邦分割。输入数据集后,我在下面收到此错误,我认为这应该是来自train.py中第88行的model.fit-generator,但我不知道为什么会收到此错误以及如何解决该错误。
model.fit_generator(train_gen, steps_per_epoch=args.epoch_steps,
epochs=args.n_epochs, validation_data=val_gen,
validation_steps=args.val_steps)
错误:
Traceback (most recent call last):
File "train.py", line 96, in <module>
main(args)
File "train.py", line 88, in main
validation_steps=args.val_steps)
File "/root/anaconda3/envs/my_env/lib/python3.6/site-packages/keras/legacy/interfaces.py", line 91, in wrapper
return func(*args, **kwargs)
File "/root/anaconda3/envs/my_env/lib/python3.6/site-packages/keras/engine/training.py", line 1418, in fit_generator
initial_epoch=initial_epoch)
File "/root/anaconda3/envs/my_env/lib/python3.6/site-packages/keras/engine/training_generator.py", line 217, in fit_generator
class_weight=class_weight)
File "/root/anaconda3/envs/my_env/lib/python3.6/site-packages/keras/engine/training.py", line 1217, in train_on_batch
outputs = self.train_function(ins)
File "/root/anaconda3/envs/my_env/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 2715, in __call__
return self._call(inputs)
File "/root/anaconda3/envs/my_env/lib/python3.6/site-packages/keras/backend/tensorflow_backend.py", line 2675, in _call
fetched = self._callable_fn(*array_vals)
File "/root/anaconda3/envs/my_env/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1439, in __call__
run_metadata_ptr)
File "/root/anaconda3/envs/my_env/lib/python3.6/site-packages/tensorflow/python/framework/errors_impl.py", line 528, in __exit__
c_api.TF_GetCode(self.status.status))
tensorflow.python.framework.errors_impl.InvalidArgumentError: indices[32768] = [1, 16, 1, 0] does not index into shape [10,16,16,512]
[[{{node max_unpooling2d_1/max_unpooling2d_1/ScatterNd}} = ScatterNd[T=DT_FLOAT, Tindices=DT_INT32, _class=["loc:@train...d/GatherNd"], _device="/job:localhost/replica:0/task:0/device:CPU:0"](max_unpooling2d_1/max_unpooling2d_1/transpose, max_unpooling2d_1/max_unpooling2d_1/Reshape_2, max_unpooling2d_1/max_unpooling2d_1/ScatterNd/shape)]]