Estimator Api : Error while training with estimator api












0















I am new to ML. I am not sure how to proceed with data reshape concepts. Earlier, tf.estimator was working fine for me. But when I tried experimenting wth new and large dataset, things started failing.



I am working on the below code.



import numpy as np
import pandas as pd
import tensorflow as tf
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
file='creditcard/creditcard.csv'
dataset=pd.read_csv(file)
dataset['Class']=dataset['Class'].astype('int')
print('Shape of dataset ',dataset.shape)
label=dataset['Class']
data=dataset.drop(['Class'],axis=1)
trainX,testX,trainY,testY=train_test_split(data,label,test_size=.3,random_state=101)
print('Shape of train data : (',trainX.shape,trainY.shape,')')
print('Shape of test data : (',testX.shape,testY.shape,')')
feature_value=[tf.feature_column.numeric_column('x')]
estimator=tf.estimator.LinearRegressor(feature_value)
train_input=tf.estimator.inputs.numpy_input_fn({'x':trainX.values},trainY.values,batch_size=512,shuffle=True)
test_input=tf.estimator.inputs.numpy_input_fn({'x':testX.values},testY.values,batch_size=512,shuffle=True)
estimator.train(input_fn=train_input,steps=1000)


When I am training my model, I am getting below error.



Can someone please help with the below :




  1. How to identify the correct shape.

  2. What correction do I need to make with the shape of data.


Error:






C:UsersvineetAppDataLocalProgramsPythonPython36python.exe C:/Users/vineet/Desktop/selfML/creditCard.py
Shape of dataset (284807, 31)
WARNING:tensorflow:Using temporary folder as model directory: C:UsersvineetAppDataLocalTemptmpbyc90zqm
Shape of train data : ( (199364, 30) (199364,) )
Shape of test data : ( (85443, 30) (85443,) )
WARNING:tensorflow:From C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorinputsqueuesfeeding_queue_runner.py:62: QueueRunner.__init__ (from tensorflow.python.training.queue_runner_impl) is deprecated and will be removed in a future version.
Instructions for updating:
To construct input pipelines, use the `tf.data` module.
WARNING:tensorflow:From C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorinputsqueuesfeeding_functions.py:500: add_queue_runner (from tensorflow.python.training.queue_runner_impl) is deprecated and will be removed in a future version.
Instructions for updating:
To construct input pipelines, use the `tf.data` module.
2018-11-24 11:19:24.242005: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
WARNING:tensorflow:From C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythontrainingmonitored_session.py:804: start_queue_runners (from tensorflow.python.training.queue_runner_impl) is deprecated and will be removed in a future version.
Instructions for updating:
To construct input pipelines, use the `tf.data` module.
Traceback (most recent call last):
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonclientsession.py", line 1292, in _do_call
return fn(*args)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonclientsession.py", line 1277, in _run_fn
options, feed_dict, fetch_list, target_list, run_metadata)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonclientsession.py", line 1367, in _call_tf_sessionrun
run_metadata)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Input to reshape is a tensor with 15360 values, but the requested shape has 512
[[{{node linear/linear_model_1/linear_model/x/Reshape}} = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:CPU:0"](linear/linear_model_1/linear_model/x/ToFloat, linear/linear_model_1/linear_model/x/Reshape/shape)]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:/Users/vineet/Desktop/selfML/creditCard.py", line 19, in <module>
estimator.train(input_fn=train_input,steps=1000)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorestimator.py", line 356, in train
loss = self._train_model(input_fn, hooks, saving_listeners)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorestimator.py", line 1181, in _train_model
return self._train_model_default(input_fn, hooks, saving_listeners)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorestimator.py", line 1215, in _train_model_default
saving_listeners)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorestimator.py", line 1409, in _train_with_estimator_spec
_, loss = mon_sess.run([estimator_spec.train_op, estimator_spec.loss])
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythontrainingmonitored_session.py", line 671, in run
run_metadata=run_metadata)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythontrainingmonitored_session.py", line 1148, in run
run_metadata=run_metadata)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythontrainingmonitored_session.py", line 1239, in run
raise six.reraise(*original_exc_info)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagessix.py", line 693, in reraise
raise value
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythontrainingmonitored_session.py", line 1224, in run
return self._sess.run(*args, **kwargs)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythontrainingmonitored_session.py", line 1296, in run
run_metadata=run_metadata)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythontrainingmonitored_session.py", line 1076, in run
return self._sess.run(*args, **kwargs)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonclientsession.py", line 887, in run
run_metadata_ptr)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonclientsession.py", line 1110, in _run
feed_dict_tensor, options, run_metadata)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonclientsession.py", line 1286, in _do_run
run_metadata)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonclientsession.py", line 1308, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Input to reshape is a tensor with 15360 values, but the requested shape has 512
[[{{node linear/linear_model_1/linear_model/x/Reshape}} = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:CPU:0"](linear/linear_model_1/linear_model/x/ToFloat, linear/linear_model_1/linear_model/x/Reshape/shape)]]

Caused by op 'linear/linear_model_1/linear_model/x/Reshape', defined at:
File "C:/Users/vineet/Desktop/selfML/creditCard.py", line 19, in <module>
estimator.train(input_fn=train_input,steps=1000)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorestimator.py", line 356, in train
loss = self._train_model(input_fn, hooks, saving_listeners)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorestimator.py", line 1181, in _train_model
return self._train_model_default(input_fn, hooks, saving_listeners)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorestimator.py", line 1211, in _train_model_default
features, labels, model_fn_lib.ModeKeys.TRAIN, self.config)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorestimator.py", line 1169, in _call_model_fn
model_fn_results = self._model_fn(features=features, **kwargs)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorcannedlinear.py", line 492, in _model_fn
sparse_combiner=sparse_combiner)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorcannedlinear.py", line 163, in _linear_model_fn
logits = logit_fn(features=features)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorcannedlinear.py", line 101, in linear_logit_fn
cols_to_vars=cols_to_vars)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonfeature_columnfeature_column.py", line 464, in linear_model
retval = linear_model_layer(features) # pylint: disable=not-callable
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonkerasenginebase_layer.py", line 769, in __call__
outputs = self.call(inputs, *args, **kwargs)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonfeature_columnfeature_column.py", line 647, in call
weighted_sum = layer(builder)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonlayersbase.py", line 364, in __call__
outputs = super(Layer, self).__call__(inputs, *args, **kwargs)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonkerasenginebase_layer.py", line 769, in __call__
outputs = self.call(inputs, *args, **kwargs)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonfeature_columnfeature_column.py", line 539, in call
weight_var=self._weight_var)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonfeature_columnfeature_column.py", line 2030, in _create_weighted_sum
weight_var=weight_var)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonfeature_columnfeature_column.py", line 2046, in _create_dense_column_weighted_sum
tensor = array_ops.reshape(tensor, shape=(batch_size, num_elements))
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonopsgen_array_ops.py", line 7546, in reshape
"Reshape", tensor=tensor, shape=shape, name=name)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonframeworkop_def_library.py", line 787, in _apply_op_helper
op_def=op_def)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonutildeprecation.py", line 488, in new_func
return func(*args, **kwargs)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonframeworkops.py", line 3272, in create_op
op_def=op_def)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonframeworkops.py", line 1768, in __init__
self._traceback = tf_stack.extract_stack()

InvalidArgumentError (see above for traceback): Input to reshape is a tensor with 15360 values, but the requested shape has 512
[[{{node linear/linear_model_1/linear_model/x/Reshape}} = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:CPU:0"](linear/linear_model_1/linear_model/x/ToFloat, linear/linear_model_1/linear_model/x/Reshape/shape)]]


Process finished with exit code 1












share|improve this question

























  • I got the solution. I was using multiple column in estimator, but I was not making all used cols as feature column.I have made the changes and now code is working fine.

    – Vineet Tripathi
    Nov 25 '18 at 14:25


















0















I am new to ML. I am not sure how to proceed with data reshape concepts. Earlier, tf.estimator was working fine for me. But when I tried experimenting wth new and large dataset, things started failing.



I am working on the below code.



import numpy as np
import pandas as pd
import tensorflow as tf
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
file='creditcard/creditcard.csv'
dataset=pd.read_csv(file)
dataset['Class']=dataset['Class'].astype('int')
print('Shape of dataset ',dataset.shape)
label=dataset['Class']
data=dataset.drop(['Class'],axis=1)
trainX,testX,trainY,testY=train_test_split(data,label,test_size=.3,random_state=101)
print('Shape of train data : (',trainX.shape,trainY.shape,')')
print('Shape of test data : (',testX.shape,testY.shape,')')
feature_value=[tf.feature_column.numeric_column('x')]
estimator=tf.estimator.LinearRegressor(feature_value)
train_input=tf.estimator.inputs.numpy_input_fn({'x':trainX.values},trainY.values,batch_size=512,shuffle=True)
test_input=tf.estimator.inputs.numpy_input_fn({'x':testX.values},testY.values,batch_size=512,shuffle=True)
estimator.train(input_fn=train_input,steps=1000)


When I am training my model, I am getting below error.



Can someone please help with the below :




  1. How to identify the correct shape.

  2. What correction do I need to make with the shape of data.


Error:






C:UsersvineetAppDataLocalProgramsPythonPython36python.exe C:/Users/vineet/Desktop/selfML/creditCard.py
Shape of dataset (284807, 31)
WARNING:tensorflow:Using temporary folder as model directory: C:UsersvineetAppDataLocalTemptmpbyc90zqm
Shape of train data : ( (199364, 30) (199364,) )
Shape of test data : ( (85443, 30) (85443,) )
WARNING:tensorflow:From C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorinputsqueuesfeeding_queue_runner.py:62: QueueRunner.__init__ (from tensorflow.python.training.queue_runner_impl) is deprecated and will be removed in a future version.
Instructions for updating:
To construct input pipelines, use the `tf.data` module.
WARNING:tensorflow:From C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorinputsqueuesfeeding_functions.py:500: add_queue_runner (from tensorflow.python.training.queue_runner_impl) is deprecated and will be removed in a future version.
Instructions for updating:
To construct input pipelines, use the `tf.data` module.
2018-11-24 11:19:24.242005: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
WARNING:tensorflow:From C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythontrainingmonitored_session.py:804: start_queue_runners (from tensorflow.python.training.queue_runner_impl) is deprecated and will be removed in a future version.
Instructions for updating:
To construct input pipelines, use the `tf.data` module.
Traceback (most recent call last):
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonclientsession.py", line 1292, in _do_call
return fn(*args)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonclientsession.py", line 1277, in _run_fn
options, feed_dict, fetch_list, target_list, run_metadata)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonclientsession.py", line 1367, in _call_tf_sessionrun
run_metadata)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Input to reshape is a tensor with 15360 values, but the requested shape has 512
[[{{node linear/linear_model_1/linear_model/x/Reshape}} = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:CPU:0"](linear/linear_model_1/linear_model/x/ToFloat, linear/linear_model_1/linear_model/x/Reshape/shape)]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:/Users/vineet/Desktop/selfML/creditCard.py", line 19, in <module>
estimator.train(input_fn=train_input,steps=1000)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorestimator.py", line 356, in train
loss = self._train_model(input_fn, hooks, saving_listeners)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorestimator.py", line 1181, in _train_model
return self._train_model_default(input_fn, hooks, saving_listeners)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorestimator.py", line 1215, in _train_model_default
saving_listeners)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorestimator.py", line 1409, in _train_with_estimator_spec
_, loss = mon_sess.run([estimator_spec.train_op, estimator_spec.loss])
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythontrainingmonitored_session.py", line 671, in run
run_metadata=run_metadata)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythontrainingmonitored_session.py", line 1148, in run
run_metadata=run_metadata)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythontrainingmonitored_session.py", line 1239, in run
raise six.reraise(*original_exc_info)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagessix.py", line 693, in reraise
raise value
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythontrainingmonitored_session.py", line 1224, in run
return self._sess.run(*args, **kwargs)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythontrainingmonitored_session.py", line 1296, in run
run_metadata=run_metadata)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythontrainingmonitored_session.py", line 1076, in run
return self._sess.run(*args, **kwargs)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonclientsession.py", line 887, in run
run_metadata_ptr)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonclientsession.py", line 1110, in _run
feed_dict_tensor, options, run_metadata)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonclientsession.py", line 1286, in _do_run
run_metadata)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonclientsession.py", line 1308, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Input to reshape is a tensor with 15360 values, but the requested shape has 512
[[{{node linear/linear_model_1/linear_model/x/Reshape}} = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:CPU:0"](linear/linear_model_1/linear_model/x/ToFloat, linear/linear_model_1/linear_model/x/Reshape/shape)]]

Caused by op 'linear/linear_model_1/linear_model/x/Reshape', defined at:
File "C:/Users/vineet/Desktop/selfML/creditCard.py", line 19, in <module>
estimator.train(input_fn=train_input,steps=1000)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorestimator.py", line 356, in train
loss = self._train_model(input_fn, hooks, saving_listeners)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorestimator.py", line 1181, in _train_model
return self._train_model_default(input_fn, hooks, saving_listeners)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorestimator.py", line 1211, in _train_model_default
features, labels, model_fn_lib.ModeKeys.TRAIN, self.config)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorestimator.py", line 1169, in _call_model_fn
model_fn_results = self._model_fn(features=features, **kwargs)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorcannedlinear.py", line 492, in _model_fn
sparse_combiner=sparse_combiner)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorcannedlinear.py", line 163, in _linear_model_fn
logits = logit_fn(features=features)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorcannedlinear.py", line 101, in linear_logit_fn
cols_to_vars=cols_to_vars)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonfeature_columnfeature_column.py", line 464, in linear_model
retval = linear_model_layer(features) # pylint: disable=not-callable
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonkerasenginebase_layer.py", line 769, in __call__
outputs = self.call(inputs, *args, **kwargs)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonfeature_columnfeature_column.py", line 647, in call
weighted_sum = layer(builder)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonlayersbase.py", line 364, in __call__
outputs = super(Layer, self).__call__(inputs, *args, **kwargs)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonkerasenginebase_layer.py", line 769, in __call__
outputs = self.call(inputs, *args, **kwargs)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonfeature_columnfeature_column.py", line 539, in call
weight_var=self._weight_var)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonfeature_columnfeature_column.py", line 2030, in _create_weighted_sum
weight_var=weight_var)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonfeature_columnfeature_column.py", line 2046, in _create_dense_column_weighted_sum
tensor = array_ops.reshape(tensor, shape=(batch_size, num_elements))
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonopsgen_array_ops.py", line 7546, in reshape
"Reshape", tensor=tensor, shape=shape, name=name)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonframeworkop_def_library.py", line 787, in _apply_op_helper
op_def=op_def)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonutildeprecation.py", line 488, in new_func
return func(*args, **kwargs)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonframeworkops.py", line 3272, in create_op
op_def=op_def)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonframeworkops.py", line 1768, in __init__
self._traceback = tf_stack.extract_stack()

InvalidArgumentError (see above for traceback): Input to reshape is a tensor with 15360 values, but the requested shape has 512
[[{{node linear/linear_model_1/linear_model/x/Reshape}} = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:CPU:0"](linear/linear_model_1/linear_model/x/ToFloat, linear/linear_model_1/linear_model/x/Reshape/shape)]]


Process finished with exit code 1












share|improve this question

























  • I got the solution. I was using multiple column in estimator, but I was not making all used cols as feature column.I have made the changes and now code is working fine.

    – Vineet Tripathi
    Nov 25 '18 at 14:25
















0












0








0


1






I am new to ML. I am not sure how to proceed with data reshape concepts. Earlier, tf.estimator was working fine for me. But when I tried experimenting wth new and large dataset, things started failing.



I am working on the below code.



import numpy as np
import pandas as pd
import tensorflow as tf
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
file='creditcard/creditcard.csv'
dataset=pd.read_csv(file)
dataset['Class']=dataset['Class'].astype('int')
print('Shape of dataset ',dataset.shape)
label=dataset['Class']
data=dataset.drop(['Class'],axis=1)
trainX,testX,trainY,testY=train_test_split(data,label,test_size=.3,random_state=101)
print('Shape of train data : (',trainX.shape,trainY.shape,')')
print('Shape of test data : (',testX.shape,testY.shape,')')
feature_value=[tf.feature_column.numeric_column('x')]
estimator=tf.estimator.LinearRegressor(feature_value)
train_input=tf.estimator.inputs.numpy_input_fn({'x':trainX.values},trainY.values,batch_size=512,shuffle=True)
test_input=tf.estimator.inputs.numpy_input_fn({'x':testX.values},testY.values,batch_size=512,shuffle=True)
estimator.train(input_fn=train_input,steps=1000)


When I am training my model, I am getting below error.



Can someone please help with the below :




  1. How to identify the correct shape.

  2. What correction do I need to make with the shape of data.


Error:






C:UsersvineetAppDataLocalProgramsPythonPython36python.exe C:/Users/vineet/Desktop/selfML/creditCard.py
Shape of dataset (284807, 31)
WARNING:tensorflow:Using temporary folder as model directory: C:UsersvineetAppDataLocalTemptmpbyc90zqm
Shape of train data : ( (199364, 30) (199364,) )
Shape of test data : ( (85443, 30) (85443,) )
WARNING:tensorflow:From C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorinputsqueuesfeeding_queue_runner.py:62: QueueRunner.__init__ (from tensorflow.python.training.queue_runner_impl) is deprecated and will be removed in a future version.
Instructions for updating:
To construct input pipelines, use the `tf.data` module.
WARNING:tensorflow:From C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorinputsqueuesfeeding_functions.py:500: add_queue_runner (from tensorflow.python.training.queue_runner_impl) is deprecated and will be removed in a future version.
Instructions for updating:
To construct input pipelines, use the `tf.data` module.
2018-11-24 11:19:24.242005: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
WARNING:tensorflow:From C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythontrainingmonitored_session.py:804: start_queue_runners (from tensorflow.python.training.queue_runner_impl) is deprecated and will be removed in a future version.
Instructions for updating:
To construct input pipelines, use the `tf.data` module.
Traceback (most recent call last):
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonclientsession.py", line 1292, in _do_call
return fn(*args)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonclientsession.py", line 1277, in _run_fn
options, feed_dict, fetch_list, target_list, run_metadata)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonclientsession.py", line 1367, in _call_tf_sessionrun
run_metadata)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Input to reshape is a tensor with 15360 values, but the requested shape has 512
[[{{node linear/linear_model_1/linear_model/x/Reshape}} = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:CPU:0"](linear/linear_model_1/linear_model/x/ToFloat, linear/linear_model_1/linear_model/x/Reshape/shape)]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:/Users/vineet/Desktop/selfML/creditCard.py", line 19, in <module>
estimator.train(input_fn=train_input,steps=1000)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorestimator.py", line 356, in train
loss = self._train_model(input_fn, hooks, saving_listeners)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorestimator.py", line 1181, in _train_model
return self._train_model_default(input_fn, hooks, saving_listeners)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorestimator.py", line 1215, in _train_model_default
saving_listeners)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorestimator.py", line 1409, in _train_with_estimator_spec
_, loss = mon_sess.run([estimator_spec.train_op, estimator_spec.loss])
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythontrainingmonitored_session.py", line 671, in run
run_metadata=run_metadata)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythontrainingmonitored_session.py", line 1148, in run
run_metadata=run_metadata)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythontrainingmonitored_session.py", line 1239, in run
raise six.reraise(*original_exc_info)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagessix.py", line 693, in reraise
raise value
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythontrainingmonitored_session.py", line 1224, in run
return self._sess.run(*args, **kwargs)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythontrainingmonitored_session.py", line 1296, in run
run_metadata=run_metadata)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythontrainingmonitored_session.py", line 1076, in run
return self._sess.run(*args, **kwargs)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonclientsession.py", line 887, in run
run_metadata_ptr)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonclientsession.py", line 1110, in _run
feed_dict_tensor, options, run_metadata)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonclientsession.py", line 1286, in _do_run
run_metadata)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonclientsession.py", line 1308, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Input to reshape is a tensor with 15360 values, but the requested shape has 512
[[{{node linear/linear_model_1/linear_model/x/Reshape}} = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:CPU:0"](linear/linear_model_1/linear_model/x/ToFloat, linear/linear_model_1/linear_model/x/Reshape/shape)]]

Caused by op 'linear/linear_model_1/linear_model/x/Reshape', defined at:
File "C:/Users/vineet/Desktop/selfML/creditCard.py", line 19, in <module>
estimator.train(input_fn=train_input,steps=1000)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorestimator.py", line 356, in train
loss = self._train_model(input_fn, hooks, saving_listeners)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorestimator.py", line 1181, in _train_model
return self._train_model_default(input_fn, hooks, saving_listeners)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorestimator.py", line 1211, in _train_model_default
features, labels, model_fn_lib.ModeKeys.TRAIN, self.config)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorestimator.py", line 1169, in _call_model_fn
model_fn_results = self._model_fn(features=features, **kwargs)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorcannedlinear.py", line 492, in _model_fn
sparse_combiner=sparse_combiner)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorcannedlinear.py", line 163, in _linear_model_fn
logits = logit_fn(features=features)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorcannedlinear.py", line 101, in linear_logit_fn
cols_to_vars=cols_to_vars)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonfeature_columnfeature_column.py", line 464, in linear_model
retval = linear_model_layer(features) # pylint: disable=not-callable
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonkerasenginebase_layer.py", line 769, in __call__
outputs = self.call(inputs, *args, **kwargs)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonfeature_columnfeature_column.py", line 647, in call
weighted_sum = layer(builder)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonlayersbase.py", line 364, in __call__
outputs = super(Layer, self).__call__(inputs, *args, **kwargs)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonkerasenginebase_layer.py", line 769, in __call__
outputs = self.call(inputs, *args, **kwargs)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonfeature_columnfeature_column.py", line 539, in call
weight_var=self._weight_var)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonfeature_columnfeature_column.py", line 2030, in _create_weighted_sum
weight_var=weight_var)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonfeature_columnfeature_column.py", line 2046, in _create_dense_column_weighted_sum
tensor = array_ops.reshape(tensor, shape=(batch_size, num_elements))
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonopsgen_array_ops.py", line 7546, in reshape
"Reshape", tensor=tensor, shape=shape, name=name)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonframeworkop_def_library.py", line 787, in _apply_op_helper
op_def=op_def)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonutildeprecation.py", line 488, in new_func
return func(*args, **kwargs)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonframeworkops.py", line 3272, in create_op
op_def=op_def)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonframeworkops.py", line 1768, in __init__
self._traceback = tf_stack.extract_stack()

InvalidArgumentError (see above for traceback): Input to reshape is a tensor with 15360 values, but the requested shape has 512
[[{{node linear/linear_model_1/linear_model/x/Reshape}} = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:CPU:0"](linear/linear_model_1/linear_model/x/ToFloat, linear/linear_model_1/linear_model/x/Reshape/shape)]]


Process finished with exit code 1












share|improve this question
















I am new to ML. I am not sure how to proceed with data reshape concepts. Earlier, tf.estimator was working fine for me. But when I tried experimenting wth new and large dataset, things started failing.



I am working on the below code.



import numpy as np
import pandas as pd
import tensorflow as tf
import matplotlib.pyplot as plt
from sklearn.model_selection import train_test_split
file='creditcard/creditcard.csv'
dataset=pd.read_csv(file)
dataset['Class']=dataset['Class'].astype('int')
print('Shape of dataset ',dataset.shape)
label=dataset['Class']
data=dataset.drop(['Class'],axis=1)
trainX,testX,trainY,testY=train_test_split(data,label,test_size=.3,random_state=101)
print('Shape of train data : (',trainX.shape,trainY.shape,')')
print('Shape of test data : (',testX.shape,testY.shape,')')
feature_value=[tf.feature_column.numeric_column('x')]
estimator=tf.estimator.LinearRegressor(feature_value)
train_input=tf.estimator.inputs.numpy_input_fn({'x':trainX.values},trainY.values,batch_size=512,shuffle=True)
test_input=tf.estimator.inputs.numpy_input_fn({'x':testX.values},testY.values,batch_size=512,shuffle=True)
estimator.train(input_fn=train_input,steps=1000)


When I am training my model, I am getting below error.



Can someone please help with the below :




  1. How to identify the correct shape.

  2. What correction do I need to make with the shape of data.


Error:






C:UsersvineetAppDataLocalProgramsPythonPython36python.exe C:/Users/vineet/Desktop/selfML/creditCard.py
Shape of dataset (284807, 31)
WARNING:tensorflow:Using temporary folder as model directory: C:UsersvineetAppDataLocalTemptmpbyc90zqm
Shape of train data : ( (199364, 30) (199364,) )
Shape of test data : ( (85443, 30) (85443,) )
WARNING:tensorflow:From C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorinputsqueuesfeeding_queue_runner.py:62: QueueRunner.__init__ (from tensorflow.python.training.queue_runner_impl) is deprecated and will be removed in a future version.
Instructions for updating:
To construct input pipelines, use the `tf.data` module.
WARNING:tensorflow:From C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorinputsqueuesfeeding_functions.py:500: add_queue_runner (from tensorflow.python.training.queue_runner_impl) is deprecated and will be removed in a future version.
Instructions for updating:
To construct input pipelines, use the `tf.data` module.
2018-11-24 11:19:24.242005: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
WARNING:tensorflow:From C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythontrainingmonitored_session.py:804: start_queue_runners (from tensorflow.python.training.queue_runner_impl) is deprecated and will be removed in a future version.
Instructions for updating:
To construct input pipelines, use the `tf.data` module.
Traceback (most recent call last):
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonclientsession.py", line 1292, in _do_call
return fn(*args)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonclientsession.py", line 1277, in _run_fn
options, feed_dict, fetch_list, target_list, run_metadata)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonclientsession.py", line 1367, in _call_tf_sessionrun
run_metadata)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Input to reshape is a tensor with 15360 values, but the requested shape has 512
[[{{node linear/linear_model_1/linear_model/x/Reshape}} = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:CPU:0"](linear/linear_model_1/linear_model/x/ToFloat, linear/linear_model_1/linear_model/x/Reshape/shape)]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:/Users/vineet/Desktop/selfML/creditCard.py", line 19, in <module>
estimator.train(input_fn=train_input,steps=1000)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorestimator.py", line 356, in train
loss = self._train_model(input_fn, hooks, saving_listeners)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorestimator.py", line 1181, in _train_model
return self._train_model_default(input_fn, hooks, saving_listeners)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorestimator.py", line 1215, in _train_model_default
saving_listeners)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorestimator.py", line 1409, in _train_with_estimator_spec
_, loss = mon_sess.run([estimator_spec.train_op, estimator_spec.loss])
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythontrainingmonitored_session.py", line 671, in run
run_metadata=run_metadata)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythontrainingmonitored_session.py", line 1148, in run
run_metadata=run_metadata)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythontrainingmonitored_session.py", line 1239, in run
raise six.reraise(*original_exc_info)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagessix.py", line 693, in reraise
raise value
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythontrainingmonitored_session.py", line 1224, in run
return self._sess.run(*args, **kwargs)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythontrainingmonitored_session.py", line 1296, in run
run_metadata=run_metadata)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythontrainingmonitored_session.py", line 1076, in run
return self._sess.run(*args, **kwargs)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonclientsession.py", line 887, in run
run_metadata_ptr)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonclientsession.py", line 1110, in _run
feed_dict_tensor, options, run_metadata)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonclientsession.py", line 1286, in _do_run
run_metadata)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonclientsession.py", line 1308, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Input to reshape is a tensor with 15360 values, but the requested shape has 512
[[{{node linear/linear_model_1/linear_model/x/Reshape}} = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:CPU:0"](linear/linear_model_1/linear_model/x/ToFloat, linear/linear_model_1/linear_model/x/Reshape/shape)]]

Caused by op 'linear/linear_model_1/linear_model/x/Reshape', defined at:
File "C:/Users/vineet/Desktop/selfML/creditCard.py", line 19, in <module>
estimator.train(input_fn=train_input,steps=1000)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorestimator.py", line 356, in train
loss = self._train_model(input_fn, hooks, saving_listeners)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorestimator.py", line 1181, in _train_model
return self._train_model_default(input_fn, hooks, saving_listeners)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorestimator.py", line 1211, in _train_model_default
features, labels, model_fn_lib.ModeKeys.TRAIN, self.config)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorestimator.py", line 1169, in _call_model_fn
model_fn_results = self._model_fn(features=features, **kwargs)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorcannedlinear.py", line 492, in _model_fn
sparse_combiner=sparse_combiner)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorcannedlinear.py", line 163, in _linear_model_fn
logits = logit_fn(features=features)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorcannedlinear.py", line 101, in linear_logit_fn
cols_to_vars=cols_to_vars)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonfeature_columnfeature_column.py", line 464, in linear_model
retval = linear_model_layer(features) # pylint: disable=not-callable
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonkerasenginebase_layer.py", line 769, in __call__
outputs = self.call(inputs, *args, **kwargs)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonfeature_columnfeature_column.py", line 647, in call
weighted_sum = layer(builder)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonlayersbase.py", line 364, in __call__
outputs = super(Layer, self).__call__(inputs, *args, **kwargs)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonkerasenginebase_layer.py", line 769, in __call__
outputs = self.call(inputs, *args, **kwargs)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonfeature_columnfeature_column.py", line 539, in call
weight_var=self._weight_var)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonfeature_columnfeature_column.py", line 2030, in _create_weighted_sum
weight_var=weight_var)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonfeature_columnfeature_column.py", line 2046, in _create_dense_column_weighted_sum
tensor = array_ops.reshape(tensor, shape=(batch_size, num_elements))
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonopsgen_array_ops.py", line 7546, in reshape
"Reshape", tensor=tensor, shape=shape, name=name)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonframeworkop_def_library.py", line 787, in _apply_op_helper
op_def=op_def)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonutildeprecation.py", line 488, in new_func
return func(*args, **kwargs)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonframeworkops.py", line 3272, in create_op
op_def=op_def)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonframeworkops.py", line 1768, in __init__
self._traceback = tf_stack.extract_stack()

InvalidArgumentError (see above for traceback): Input to reshape is a tensor with 15360 values, but the requested shape has 512
[[{{node linear/linear_model_1/linear_model/x/Reshape}} = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:CPU:0"](linear/linear_model_1/linear_model/x/ToFloat, linear/linear_model_1/linear_model/x/Reshape/shape)]]


Process finished with exit code 1








C:UsersvineetAppDataLocalProgramsPythonPython36python.exe C:/Users/vineet/Desktop/selfML/creditCard.py
Shape of dataset (284807, 31)
WARNING:tensorflow:Using temporary folder as model directory: C:UsersvineetAppDataLocalTemptmpbyc90zqm
Shape of train data : ( (199364, 30) (199364,) )
Shape of test data : ( (85443, 30) (85443,) )
WARNING:tensorflow:From C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorinputsqueuesfeeding_queue_runner.py:62: QueueRunner.__init__ (from tensorflow.python.training.queue_runner_impl) is deprecated and will be removed in a future version.
Instructions for updating:
To construct input pipelines, use the `tf.data` module.
WARNING:tensorflow:From C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorinputsqueuesfeeding_functions.py:500: add_queue_runner (from tensorflow.python.training.queue_runner_impl) is deprecated and will be removed in a future version.
Instructions for updating:
To construct input pipelines, use the `tf.data` module.
2018-11-24 11:19:24.242005: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
WARNING:tensorflow:From C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythontrainingmonitored_session.py:804: start_queue_runners (from tensorflow.python.training.queue_runner_impl) is deprecated and will be removed in a future version.
Instructions for updating:
To construct input pipelines, use the `tf.data` module.
Traceback (most recent call last):
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonclientsession.py", line 1292, in _do_call
return fn(*args)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonclientsession.py", line 1277, in _run_fn
options, feed_dict, fetch_list, target_list, run_metadata)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonclientsession.py", line 1367, in _call_tf_sessionrun
run_metadata)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Input to reshape is a tensor with 15360 values, but the requested shape has 512
[[{{node linear/linear_model_1/linear_model/x/Reshape}} = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:CPU:0"](linear/linear_model_1/linear_model/x/ToFloat, linear/linear_model_1/linear_model/x/Reshape/shape)]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:/Users/vineet/Desktop/selfML/creditCard.py", line 19, in <module>
estimator.train(input_fn=train_input,steps=1000)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorestimator.py", line 356, in train
loss = self._train_model(input_fn, hooks, saving_listeners)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorestimator.py", line 1181, in _train_model
return self._train_model_default(input_fn, hooks, saving_listeners)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorestimator.py", line 1215, in _train_model_default
saving_listeners)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorestimator.py", line 1409, in _train_with_estimator_spec
_, loss = mon_sess.run([estimator_spec.train_op, estimator_spec.loss])
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythontrainingmonitored_session.py", line 671, in run
run_metadata=run_metadata)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythontrainingmonitored_session.py", line 1148, in run
run_metadata=run_metadata)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythontrainingmonitored_session.py", line 1239, in run
raise six.reraise(*original_exc_info)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagessix.py", line 693, in reraise
raise value
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythontrainingmonitored_session.py", line 1224, in run
return self._sess.run(*args, **kwargs)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythontrainingmonitored_session.py", line 1296, in run
run_metadata=run_metadata)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythontrainingmonitored_session.py", line 1076, in run
return self._sess.run(*args, **kwargs)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonclientsession.py", line 887, in run
run_metadata_ptr)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonclientsession.py", line 1110, in _run
feed_dict_tensor, options, run_metadata)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonclientsession.py", line 1286, in _do_run
run_metadata)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonclientsession.py", line 1308, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Input to reshape is a tensor with 15360 values, but the requested shape has 512
[[{{node linear/linear_model_1/linear_model/x/Reshape}} = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:CPU:0"](linear/linear_model_1/linear_model/x/ToFloat, linear/linear_model_1/linear_model/x/Reshape/shape)]]

Caused by op 'linear/linear_model_1/linear_model/x/Reshape', defined at:
File "C:/Users/vineet/Desktop/selfML/creditCard.py", line 19, in <module>
estimator.train(input_fn=train_input,steps=1000)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorestimator.py", line 356, in train
loss = self._train_model(input_fn, hooks, saving_listeners)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorestimator.py", line 1181, in _train_model
return self._train_model_default(input_fn, hooks, saving_listeners)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorestimator.py", line 1211, in _train_model_default
features, labels, model_fn_lib.ModeKeys.TRAIN, self.config)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorestimator.py", line 1169, in _call_model_fn
model_fn_results = self._model_fn(features=features, **kwargs)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorcannedlinear.py", line 492, in _model_fn
sparse_combiner=sparse_combiner)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorcannedlinear.py", line 163, in _linear_model_fn
logits = logit_fn(features=features)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorcannedlinear.py", line 101, in linear_logit_fn
cols_to_vars=cols_to_vars)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonfeature_columnfeature_column.py", line 464, in linear_model
retval = linear_model_layer(features) # pylint: disable=not-callable
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonkerasenginebase_layer.py", line 769, in __call__
outputs = self.call(inputs, *args, **kwargs)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonfeature_columnfeature_column.py", line 647, in call
weighted_sum = layer(builder)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonlayersbase.py", line 364, in __call__
outputs = super(Layer, self).__call__(inputs, *args, **kwargs)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonkerasenginebase_layer.py", line 769, in __call__
outputs = self.call(inputs, *args, **kwargs)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonfeature_columnfeature_column.py", line 539, in call
weight_var=self._weight_var)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonfeature_columnfeature_column.py", line 2030, in _create_weighted_sum
weight_var=weight_var)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonfeature_columnfeature_column.py", line 2046, in _create_dense_column_weighted_sum
tensor = array_ops.reshape(tensor, shape=(batch_size, num_elements))
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonopsgen_array_ops.py", line 7546, in reshape
"Reshape", tensor=tensor, shape=shape, name=name)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonframeworkop_def_library.py", line 787, in _apply_op_helper
op_def=op_def)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonutildeprecation.py", line 488, in new_func
return func(*args, **kwargs)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonframeworkops.py", line 3272, in create_op
op_def=op_def)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonframeworkops.py", line 1768, in __init__
self._traceback = tf_stack.extract_stack()

InvalidArgumentError (see above for traceback): Input to reshape is a tensor with 15360 values, but the requested shape has 512
[[{{node linear/linear_model_1/linear_model/x/Reshape}} = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:CPU:0"](linear/linear_model_1/linear_model/x/ToFloat, linear/linear_model_1/linear_model/x/Reshape/shape)]]


Process finished with exit code 1





C:UsersvineetAppDataLocalProgramsPythonPython36python.exe C:/Users/vineet/Desktop/selfML/creditCard.py
Shape of dataset (284807, 31)
WARNING:tensorflow:Using temporary folder as model directory: C:UsersvineetAppDataLocalTemptmpbyc90zqm
Shape of train data : ( (199364, 30) (199364,) )
Shape of test data : ( (85443, 30) (85443,) )
WARNING:tensorflow:From C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorinputsqueuesfeeding_queue_runner.py:62: QueueRunner.__init__ (from tensorflow.python.training.queue_runner_impl) is deprecated and will be removed in a future version.
Instructions for updating:
To construct input pipelines, use the `tf.data` module.
WARNING:tensorflow:From C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorinputsqueuesfeeding_functions.py:500: add_queue_runner (from tensorflow.python.training.queue_runner_impl) is deprecated and will be removed in a future version.
Instructions for updating:
To construct input pipelines, use the `tf.data` module.
2018-11-24 11:19:24.242005: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2
WARNING:tensorflow:From C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythontrainingmonitored_session.py:804: start_queue_runners (from tensorflow.python.training.queue_runner_impl) is deprecated and will be removed in a future version.
Instructions for updating:
To construct input pipelines, use the `tf.data` module.
Traceback (most recent call last):
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonclientsession.py", line 1292, in _do_call
return fn(*args)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonclientsession.py", line 1277, in _run_fn
options, feed_dict, fetch_list, target_list, run_metadata)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonclientsession.py", line 1367, in _call_tf_sessionrun
run_metadata)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Input to reshape is a tensor with 15360 values, but the requested shape has 512
[[{{node linear/linear_model_1/linear_model/x/Reshape}} = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:CPU:0"](linear/linear_model_1/linear_model/x/ToFloat, linear/linear_model_1/linear_model/x/Reshape/shape)]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "C:/Users/vineet/Desktop/selfML/creditCard.py", line 19, in <module>
estimator.train(input_fn=train_input,steps=1000)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorestimator.py", line 356, in train
loss = self._train_model(input_fn, hooks, saving_listeners)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorestimator.py", line 1181, in _train_model
return self._train_model_default(input_fn, hooks, saving_listeners)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorestimator.py", line 1215, in _train_model_default
saving_listeners)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorestimator.py", line 1409, in _train_with_estimator_spec
_, loss = mon_sess.run([estimator_spec.train_op, estimator_spec.loss])
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythontrainingmonitored_session.py", line 671, in run
run_metadata=run_metadata)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythontrainingmonitored_session.py", line 1148, in run
run_metadata=run_metadata)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythontrainingmonitored_session.py", line 1239, in run
raise six.reraise(*original_exc_info)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagessix.py", line 693, in reraise
raise value
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythontrainingmonitored_session.py", line 1224, in run
return self._sess.run(*args, **kwargs)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythontrainingmonitored_session.py", line 1296, in run
run_metadata=run_metadata)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythontrainingmonitored_session.py", line 1076, in run
return self._sess.run(*args, **kwargs)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonclientsession.py", line 887, in run
run_metadata_ptr)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonclientsession.py", line 1110, in _run
feed_dict_tensor, options, run_metadata)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonclientsession.py", line 1286, in _do_run
run_metadata)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonclientsession.py", line 1308, in _do_call
raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Input to reshape is a tensor with 15360 values, but the requested shape has 512
[[{{node linear/linear_model_1/linear_model/x/Reshape}} = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:CPU:0"](linear/linear_model_1/linear_model/x/ToFloat, linear/linear_model_1/linear_model/x/Reshape/shape)]]

Caused by op 'linear/linear_model_1/linear_model/x/Reshape', defined at:
File "C:/Users/vineet/Desktop/selfML/creditCard.py", line 19, in <module>
estimator.train(input_fn=train_input,steps=1000)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorestimator.py", line 356, in train
loss = self._train_model(input_fn, hooks, saving_listeners)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorestimator.py", line 1181, in _train_model
return self._train_model_default(input_fn, hooks, saving_listeners)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorestimator.py", line 1211, in _train_model_default
features, labels, model_fn_lib.ModeKeys.TRAIN, self.config)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorestimator.py", line 1169, in _call_model_fn
model_fn_results = self._model_fn(features=features, **kwargs)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorcannedlinear.py", line 492, in _model_fn
sparse_combiner=sparse_combiner)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorcannedlinear.py", line 163, in _linear_model_fn
logits = logit_fn(features=features)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonestimatorcannedlinear.py", line 101, in linear_logit_fn
cols_to_vars=cols_to_vars)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonfeature_columnfeature_column.py", line 464, in linear_model
retval = linear_model_layer(features) # pylint: disable=not-callable
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonkerasenginebase_layer.py", line 769, in __call__
outputs = self.call(inputs, *args, **kwargs)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonfeature_columnfeature_column.py", line 647, in call
weighted_sum = layer(builder)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonlayersbase.py", line 364, in __call__
outputs = super(Layer, self).__call__(inputs, *args, **kwargs)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonkerasenginebase_layer.py", line 769, in __call__
outputs = self.call(inputs, *args, **kwargs)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonfeature_columnfeature_column.py", line 539, in call
weight_var=self._weight_var)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonfeature_columnfeature_column.py", line 2030, in _create_weighted_sum
weight_var=weight_var)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonfeature_columnfeature_column.py", line 2046, in _create_dense_column_weighted_sum
tensor = array_ops.reshape(tensor, shape=(batch_size, num_elements))
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonopsgen_array_ops.py", line 7546, in reshape
"Reshape", tensor=tensor, shape=shape, name=name)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonframeworkop_def_library.py", line 787, in _apply_op_helper
op_def=op_def)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonutildeprecation.py", line 488, in new_func
return func(*args, **kwargs)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonframeworkops.py", line 3272, in create_op
op_def=op_def)
File "C:UsersvineetAppDataLocalProgramsPythonPython36libsite-packagestensorflowpythonframeworkops.py", line 1768, in __init__
self._traceback = tf_stack.extract_stack()

InvalidArgumentError (see above for traceback): Input to reshape is a tensor with 15360 values, but the requested shape has 512
[[{{node linear/linear_model_1/linear_model/x/Reshape}} = Reshape[T=DT_FLOAT, Tshape=DT_INT32, _device="/job:localhost/replica:0/task:0/device:CPU:0"](linear/linear_model_1/linear_model/x/ToFloat, linear/linear_model_1/linear_model/x/Reshape/shape)]]


Process finished with exit code 1






tensorflow-estimator






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 24 '18 at 6:22







Vineet Tripathi

















asked Nov 24 '18 at 6:10









Vineet TripathiVineet Tripathi

163




163













  • I got the solution. I was using multiple column in estimator, but I was not making all used cols as feature column.I have made the changes and now code is working fine.

    – Vineet Tripathi
    Nov 25 '18 at 14:25





















  • I got the solution. I was using multiple column in estimator, but I was not making all used cols as feature column.I have made the changes and now code is working fine.

    – Vineet Tripathi
    Nov 25 '18 at 14:25



















I got the solution. I was using multiple column in estimator, but I was not making all used cols as feature column.I have made the changes and now code is working fine.

– Vineet Tripathi
Nov 25 '18 at 14:25







I got the solution. I was using multiple column in estimator, but I was not making all used cols as feature column.I have made the changes and now code is working fine.

– Vineet Tripathi
Nov 25 '18 at 14:25














0






active

oldest

votes











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53455647%2festimator-api-error-while-training-with-estimator-api%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53455647%2festimator-api-error-while-training-with-estimator-api%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

404 Error Contact Form 7 ajax form submitting

How to know if a Active Directory user can login interactively

TypeError: fit_transform() missing 1 required positional argument: 'X'