Я тренирую модель, чтобы классифицировать видеоклипы по двум меткам, в то время как потери модели остаются прежними, поэтому мне интересно, какие значения прогноза будут происходить во время обучения, я попробую, потом приходит ошибка:
Cannot assign a device for operation 'replica_1_5/model_12/activation_7/Softmax': Could not satisfy explicit device specification '/device:GPU:1' because no supported kernel for GPU devices is available.
Registered kernels:
device='CPU'; T in [DT_HALF]
device='CPU'; T in [DT_FLOAT]
device='CPU'; T in [DT_DOUBLE]
[[Node: replica_1_5/model_12/activation_7/Softmax = Softmax[T=DT_FLOAT, _device="/device:GPU:1"](replica_1_5/model_12/dense_21/BiasAdd)]]
During handling of the above exception, another exception occurred:
...
...
<ipython-input-29-a6bbc0e2d9db> in tf_loss(gen, ground)
110 def tf_loss(gen,ground):
111 with tf.Session() as sess:
--> 112 print(' gen:',sess.run(gen),' ground:',sess.run(ground))
113 return K.binary_crossentropy(gen,ground)
114
C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\client\session.py in run(self, fetches, feed_dict, options, run_metadata)
898 try:
899 result = self._run(None, fetches, feed_dict, options_ptr,
--> 900 run_metadata_ptr)
901 if run_metadata:
902 proto_data = tf_session.TF_GetBuffer(run_metadata_ptr)
C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\client\session.py in _run(self, handle, fetches, feed_dict, options, run_metadata)
1133 if final_fetches or final_targets or (handle and feed_dict_tensor):
1134 results = self._do_run(handle, final_targets, final_fetches,
-> 1135 feed_dict_tensor, options, run_metadata)
1136 else:
1137 results = []
...
здесь происходит ошибка:
parallel_model.compile(loss=tf_loss, optimizer=Adam(lr=1e-4), metrics=['accuracy'])
def tf_loss(gen,ground):
with tf.Session() as sess:
print(' gen:',sess.run(gen),' ground:',sess.run(ground))
return K.binary_crossentropy(gen,ground)
введите описание изображения здесь