2017-11-09 6 views
0

WideAndDeepモデルを実行しようとすると、誰かがこのTensorFlow(1.3)エラーで私を助けることができます。私の正気の限界で。Tensorflowサポートされていないフィードの種類

エラー: tensorflow.python.framework.errors_impl.InternalError:サポートされていないフィードタイプ

フルスタック:私は検索から見てきた唯一のことは、このコードがある

2017-11-09 00:42:06.024911: I tensorflow/core/common_runtime/gpu/gpu_device.cc:965] Found device 0 with properties: 
name: Tesla K80 major: 3 minor: 7 memoryClockRate(GHz): 0.8235 
pciBusID: 0000:00:1e.0 
totalMemory: 11.17GiB freeMemory: 11.10GiB 
2017-11-09 00:42:06.024939: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1055] Creating TensorFlow device (/device:GPU:0) -> (device: 0, name: Tesla K80, pci bus id: 0000:00:1e.0, compute capability: 3.7) 
Traceback (most recent call last): 
File "/home/centos/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1321, in _do_call 
return fn(*args) 
File "/home/centos/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1300, in _run_fn 
status, run_metadata) 
File "/home/centos/anaconda3/lib/python3.6/contextlib.py", line 89, in __exit__ 
next(self.gen) 
File "/home/centos/anaconda3/lib/python3.6/site-packages/tensorflow/python/framework/errors_impl.py", line 467, in raise_exception_on_not_ok_status 
c_api.TF_GetCode(status.status)) 
tensorflow.python.framework.errors_impl.InternalError: Unsupported feed type 

During handling of the above exception, another exception occurred: 

Traceback (most recent call last):  
File "BareBonesWideDeep.py", line 152, in <module> 
train_and_eval('', 'wide_n_deep', 50,'', '') 
File "BareBonesWideDeep.py", line 129, in train_and_eval 
m.train(input_fn=input_fn(train_file_name, num_epochs=None, shuffle=True), steps=train_steps) 
File "/home/centos/anaconda3/lib/python3.6/site-packages/tensorflow/python/estimator/estimator.py", line 255, in train 
loss = self._train_model(input_fn=input_fn, hooks=hooks) 
File "/home/centos/anaconda3/lib/python3.6/site-packages/tensorflow/python/estimator/estimator.py", line 717, in _train_model 
_, loss = mon_sess.run([estimator_spec.train_op, estimator_spec.loss]) 
File "/home/centos/anaconda3/lib/python3.6/site-packages/tensorflow/python/training/monitored_session.py", line 537, in __exit__ 
self._close_internal(exception_type) 
File "/home/centos/anaconda3/lib/python3.6/site-packages/tensorflow/python/training/monitored_session.py", line 574, in _close_internal 
self._sess.close() 
File "/home/centos/anaconda3/lib/python3.6/site-packages/tensorflow/python/training/monitored_session.py", line 820, in close 
self._sess.close() 
File "/home/centos/anaconda3/lib/python3.6/site-packages/tensorflow/python/training/monitored_session.py", line 941, in close 
ignore_live_threads=True) 
File "/home/centos/anaconda3/lib/python3.6/site-packages/tensorflow/python/training/coordinator.py", line 389, in join 
six.reraise(*self._exc_info_to_raise) 
File "/home/centos/anaconda3/lib/python3.6/site-packages/six.py", line 685, in reraise 
raise value.with_traceback(tb) 
File "/home/centos/anaconda3/lib/python3.6/site-packages/tensorflow/python/estimator/inputs/queues/feeding_queue_runner.py", line 94, in _run 
sess.run(enqueue_op, feed_dict=feed_dict) 
File "/home/centos/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 889, in run 
run_metadata_ptr) 
File "/home/centos/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1118, in _run 
feed_dict_tensor, options, run_metadata) 
File "/home/centos/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1315, in _do_run 
options, run_metadata) 
File "/home/centos/anaconda3/lib/python3.6/site-packages/tensorflow/python/client/session.py", line 1334, in _do_call 
raise type(e)(node_def, op, message) 
tensorflow.python.framework.errors_impl.InternalError: Unsupported feed type 

Tensorflowのもので、PythonからTF内部へのデータマッピングを行い、 "サポートされていないフィードの種類"をスローします。それはinput_fcnを呼び出す場所スタックトレース内の私のコードの最後がm.trainさ

f_1  float64 
f_2  float64 
f_3  float64 
f_4  float64 
f_5  float64 
f_6  float64 
f_7  float64 
f_8  float64 
f_9  float64 
f_10 float64 
f_11 float64 
f_12  object 
f_13 float64 

print("Training.....") 
print('num_epochs train_and_eval:' + str(train_steps)) 
m.train(input_fn=input_fn(train_file_name, num_epochs=None, 
shuffle=True), steps=train_steps) 

def input_fn(data_file, num_epochs, shuffle): 
    """Input builder function.""" 
    df_data = pd.read_csv('data.csv') 
    df_data.fillna(0, inplace = True) 
    df_data = df_data[df_data['y_actual_bucket']>=-4] 
    df_data.f_12 = df_data.f_12.astype(str) 
    df_data['f_12'] = 'a' 
    print("CSV file data dimensions:",df_data.shape) 
    print('num_epochs input_fn:' + str(num_epochs)) 
    labels = df_data["y_actual_bucket"]#.apply(lambda x: ">50K" in x).astype(int) 
    labels = labels+4 
    df_data = df_data.iloc[:,5:] 
    train_test_cutoff = int(df_data.shape[0]*.7) 
    if data_file == 'fake1': 
     df_data = df_data.iloc[:train_test_cutoff,:] 
     labels = labels.iloc[:train_test_cutoff] 
     print("Training data shape:", df_data.shape) 
    else: 
     df_data = df_data.iloc[train_test_cutoff:,:] 
     labels = labels.iloc[train_test_cutoff:] 
     print("test data shape:", df_data.shape) 
    print(df_data.dtypes) 
    return tf.estimator.inputs.pandas_input_fn(
     x=df_data, 
     y=labels, 
     batch_size=100, 
     num_epochs=num_epochs, 
     shuffle=shuffle, 
     num_threads=1) 

答えて

0

これがある中で、私の機能のデータ型の結果を印刷 https://github.com/petewarden/tensorflow_makefile/blob/master/tensorflow/python/client/tf_session_helper.cc

非常に刺激的で、役に立たないエラーメッセージ。私はfloat32に私の機能やラベルを強制することによってそれを解決:

df2 = df1.apply(lambda x: x.astype('float32'))

私はfloat32からtf.feature_column.numeric_column()デフォルトので、このエラーが発生すると考えています。

関連する問題