tensorflowpython32_“colocate”与“tou int32”在积分tensorflow和Keras时出现

我想分析一下,当同时使用tensorflow和keras时,为什么在我的简单代码中会出现这样的错误X=tf.placeholder(tf.float32,shape=(None,1))

hidden=Dense(neu, activation='sigmoid',

kernel_regularizer=keras.regularizers.l1_l2(l1=lamb, l2=lamb))

(X) #colocate_with occurs

neural=Dense(1,

kernel_regularizer=keras.regularizers.l1_l2(l1=lamb, l2=lamb))

(hidden)

output=X+X**2*neural

first_term=tf.gradients(tf.gradients(output,X),X)[0] #to_int32 occurs

详细警告是WARNING:tensorflow:From

D:\Anaconda3\envs\ML\lib\site-packages\tensorflow\python\framework\op_def_library.py:263:

colocate_with (from tensorflow.python.framework.ops) is deprecated and

will be removed in a future version. Instructions for updating:

Colocations handled automatically by placer.

以及WARNING:tensorflow:From

D:\Anaconda3\envs\ML\lib\site-packages\tensorflow\python\ops\math_ops.py:3066:

to_int32 (from tensorflow.python.ops.math_ops) is deprecated and will

be removed in a future version. Instructions for updating: Use tf.cast

instead.

我认为这是两个独立的问题。

你有什么解决办法吗?在

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值