python string转float报错_Tensorflow:使用tflearn时不支持将字符串强制转换为float的错误,尽管数据中没有字符串...

W tensorflow/core/framework/op_kernel.cc:958]Unimplemented:Caststring to floatisnotsupported

E tensorflow/core/common_runtime/executor.cc:334]Executorfailed to create kernel.Unimplemented:Caststring to floatisnotsupported[[Node:Adam/apply_grad_op_0/update_FullyConnected_1/b/Cast_2=Cast[DstT=DT_FLOAT,SrcT=DT_STRING,_class=["loc:@FullyConnected_1/b"],_device="/job:localhost/replica:0/task:0/cpu:0"](Adam/apply_grad_op_0/learning_rate)]]W tensorflow/core/framework/op_kernel.cc:958]Unimplemented:Caststring to floatisnotsupported

E tensorflow/core/common_runtime/executor.cc:334]Executorfailed to create kernel.Unimplemented:Caststring to floatisnotsupported[[Node:Adam/apply_grad_op_0/update_Conv2D/W/Cast_2=Cast[DstT=DT_FLOAT,SrcT=DT_STRING,_class=["loc:@Conv2D/W"],_device="/job:localhost/replica:0/task:0/cpu:0"](Adam/apply_grad_op_0/learning_rate)]]--Traceback(most recent call last):File"code.py",line63,insnapshot_step=100,show_metric=True,run_id='convnet_images')File"/usr/local/lib/python2.7/dist-packages/tflearn/models/dnn.py",line214,infit

callbacks=callbacks)File"/usr/local/lib/python2.7/dist-packages/tflearn/helpers/trainer.py",line304,infit

show_metric)File"/usr/local/lib/python2.7/dist-packages/tflearn/helpers/trainer.py",line759,in_train

feed_batch)File"/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py",line717,inrun

run_metadata_ptr)File"/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py",line915,in_run

feed_dict_string,options,run_metadata)File"/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py",line965,in_do_run

target_list,options,run_metadata)File"/usr/local/lib/python2.7/dist-packages/tensorflow/python/client/session.py",line985,in_do_callraisetype(e)(node_def,op,message)tensorflow.python.framework.errors.UnimplementedError:Caststring to floatisnotsupported[[Node:Adam/apply_grad_op_0/update_Conv2D/W/Cast_2=Cast[DstT=DT_FLOAT,SrcT=DT_STRING,_class=["loc:@Conv2D/W"],_device="/job:localhost/replica:0/task:0/cpu:0"](Adam/apply_grad_op_0/learning_rate)]]Causedby op u'Adam/apply_grad_op_0/update_Conv2D/W/Cast_2',defined at:File"code.py",line59,inmodel=tflearn.DNN(network,tensorboard_verbose=3)File"/usr/local/lib/python2.7/dist-packages/tflearn/models/dnn.py",line63,in__init__

best_val_accuracy=best_val_accuracy)File"/usr/local/lib/python2.7/dist-packages/tflearn/helpers/trainer.py",line119,in__init__

clip_gradients)File"/usr/local/lib/python2.7/dist-packages/tflearn/helpers/trainer.py",line649,ininitialize_training_ops

name="apply_grad_op_"+str(i))File"/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/optimizer.py",line322,inapply_gradients

update_ops.append(self._apply_dense(grad,var))File"/usr/local/lib/python2.7/dist-packages/tensorflow/python/training/adam.py",line135,in_apply_dense

math_ops.cast(self._lr_t,var.dtype.base_dtype),File"/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/math_ops.py",line616,incastreturngen_math_ops.cast(x,base_type,name=name)File"/usr/local/lib/python2.7/dist-packages/tensorflow/python/ops/gen_math_ops.py",line419,incast

result=_op_def_lib.apply_op("Cast",x=x,DstT=DstT,name=name)File"/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/op_def_library.py",line749,inapply_op

op_def=op_def)File"/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py",line2380,increate_op

original_op=self._default_original_op,op_def=op_def)File"/usr/local/lib/python2.7/dist-packages/tensorflow/python/framework/ops.py",line1298,in__init__

self._traceback=_extract_stack()UnimplementedError(see abovefortraceback):Caststring to floatisnotsupported[[Node:Adam/apply_grad_op_0/update_Conv2D/W/Cast_2=Cast[DstT=DT_FLOAT,SrcT=DT_STRING,_class=["loc:@Conv2D/W"],_device="/job:localhost/replica:0/task:0/cpu:0"](Adam/apply_grad_op_0/learning_rate)]]

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值