我正在编写一个神经网络,但遇到“在执行图形时不允许使用 ID start_time end_time duration
<chr> <dttm> <dttm> <drtn>
1 A001 2019-06-18 05:18:00 2019-06-18 06:00:00 42 mins
2 A001 2019-06-18 06:00:00 2019-06-18 07:00:00 60 mins
3 A001 2019-06-18 07:00:00 2019-06-18 08:00:00 60 mins
4 A001 2019-06-18 08:00:00 2019-06-18 08:41:00 41 mins
5 A002 2020-03-04 05:59:00 2020-03-04 06:00:00 1 mins
6 A002 2020-03-04 06:00:00 2020-03-04 06:04:00 4 mins
7 A003 2019-05-10 19:00:00 2019-05-10 19:00:00 0 mins
8 A003 2019-05-10 19:00:00 2019-05-10 19:08:00 8 mins
9 A004 2020-01-06 22:42:00 2020-01-06 23:00:00 18 mins
10 A004 2020-01-06 23:00:00 2020-01-07 00:00:00 60 mins
11 A004 2020-01-07 00:00:00 2020-01-07 01:00:00 60 mins
12 A004 2020-01-07 01:00:00 2020-01-07 02:00:00 60 mins
13 A004 2020-01-07 02:00:00 2020-01-07 03:00:00 60 mins
14 A004 2020-01-07 03:00:00 2020-01-07 03:10:00 10 mins
作为Python tf.Tensor
作为Python”的错误,我在调用编译时无法解决。我已经编写了自己的自定义损失,我认为这是引发错误的原因。
bool
我尝试使用numpy()或nd_array()将D2I,D2L,C转换为数组,但它们都引发了tensorflow错误。任何帮助,将不胜感激 还尝试将损失更改为
def compute_loss(Z5, Z6, C, YC, YI, YL):
cost1 = np.add(np.matmul(-(Z5), YI), np.log(np.add(1, np.exp(Z5))))
cost1 = np.add(Z6, np.add(-np.dot(Z6, YL), np.log(np.add(1, exp(-Z6)))))
cost2 = np.add(Z5, np.add(-np.dot(Z5, YI), np.log(np.add(1, exp(-Z5)))))
cost1 = np.add(C, np.add(-np.dot(C, YC), np.log(np.add(1, exp(-YC)))))
return cost
d2, D2I, D2L, C = d2(images) #call function to build network
custom_loss = compute_loss(D2I, D2L, C, y_c, y_i, y_l)
my_metric = tf.keras.metrics.Accuracy(name="accuracy", dtype=None)
d2.compile(optimizer=opt, loss=custom_loss, metrics=[tf.keras.metrics.Accuracy()], run_eagerly=True)
但是抛出了同样的错误