Traceback (most recent call last):
File "train.py", line 145, in <module>
net = model_inst(input_channels = 1, output_channels = keypoints_num)
File "/home/oriuser/mounted/src/mymodel.py", line 176, in model_inst
x = Dense(44, activation = 'relu')(x) #Changed
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/base_layer.py", line 591, in __call__
self._maybe_build(inputs)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/base_layer.py", line 1881, in _maybe_build
self.build(input_shapes)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/layers/core.py", line 1005, in build
raise ValueError('The last dimension of the inputs to `Dense` '
ValueError: The last dimension of the inputs to `Dense` should be defined. Found `None`.
x = Reshape((output_channels, -1))(x)
Traceback (most recent call last):
File "train.py", line 177, in <module>
history = net.fit_generator(train_set, steps_per_epoch = steps_per_epoch_train, epochs = epochs_num, verbose = 1, callbacks = [cp_callback], validation_data = val_set, validation_steps = steps_per_epoch_val, workers = 0, use_multiprocessing = False, shuffle = True, initial_epoch = 0) #Changed
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/training.py", line 1433, in fit_generator
steps_name='steps_per_epoch')
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/training_generator.py", line 264, in model_iteration
batch_outs = batch_function(*batch_data)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/training.py", line 1153, in train_on_batch
extract_tensors_from_dataset=True)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/training.py", line 2692, in _standardize_user_data
y, self._feed_loss_fns, feed_output_shapes)
File "/usr/local/lib/python3.6/dist-packages/tensorflow/python/keras/engine/training_utils.py", line 549, in check_loss_and_target_compatibility
' while using as loss `' + loss_name + '`. '
ValueError: A target array with shape (4, 21, 3) was passed for an output of shape (None, 21, 22, 22, 3) while using as loss `mean_squared_error`. This loss expects targets to have the same shape as the output.
Could you please specify tensorflow and keras versions? (I guess this is the issue: I use different versions of tensorflow)