WARNING:tensorflow:From /home/ant/.conda/envs/lxh_tf/lib/python3.7/site-packages/tensorflow_core/python/ops/resource_variable_ops.py:1630: calling Base
ResourceVariable.init (from tensorflow.python.ops.resource_variable_ops) with constraint is deprecated and will be removed in a future version.Instructions for updating:
If using Keras pass *_constraint arguments to layers.
Traceback (most recent call last):
File "sdne_wiki.py", line 54, in
model = SDNE(G, hidden_size=[256, 128],)
File "/home/ant/researchInstitute/luoxianhao/ge/shenweichen/graphEmbedding/ge/models/sdne.py", line 93, in init
self.reset_model()
File "/home/ant/researchInstitute/luoxianhao/ge/shenweichen/graphEmbedding/ge/models/sdne.py", line 101, in reset_model
self.model.compile(opt, [l_2nd(self.beta), l_1st(self.alpha)])
File "/home/ant/.conda/envs/lxh_tf/lib/python3.7/site-packages/tensorflow_core/python/training/tracking/base.py", line 457, in _method_wrapper
result = method(self, *args, **kwargs)
File "/home/ant/.conda/envs/lxh_tf/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/training.py", line 373, in compile
self._compile_weights_loss_and_weighted_metrics()
File "/home/ant/.conda/envs/lxh_tf/lib/python3.7/site-packages/tensorflow_core/python/training/tracking/base.py", line 457, in _method_wrapper
result = method(self, *args, **kwargs)
File "/home/ant/.conda/envs/lxh_tf/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/training.py", line 1652, in compile_weights_loss
and_weighted_metrics self.total_loss = self._prepare_total_loss(masks)
File "/home/ant/.conda/envs/lxh_tf/lib/python3.7/site-packages/tensorflow_core/python/keras/engine/training.py", line 1712, in _prepare_total_loss
per_sample_losses = loss_fn.call(y_true, y_pred)
File "/home/ant/.conda/envs/lxh_tf/lib/python3.7/site-packages/tensorflow_core/python/keras/losses.py", line 216, in call
return self.fn(y_true, y_pred, **self.fn_kwargs)
File "/home/ant/researchInstitute/luoxianhao/ge/shenweichen/graphEmbedding/ge/models/sdne.py", line 37, in loss_2nd
b[y_true != 0] = beta
TypeError: 'Tensor' object does not support item assignment
编译环境:tf1.15
如何修改下面这行代码
b_[y_true != 0] = beta