python出现invalid argument什么意思_运行时出现InvalidArgumentError模型.拟合()

InvalidArgumentError Traceback (most recent call

last) in ()

3 batch_size=32,

4 epochs=1,

----> 5 validation_split=0.3)

~\Anaconda3\lib\site-packages\tensorflow\python\keras\engine\training.py

in fit(self, x, y, batch_size, epochs, verbose, callbacks,

validation_split, validation_data, shuffle, class_weight,

sample_weight, initial_epoch, steps_per_epoch, validation_steps,

**kwargs) 1361 initial_epoch=initial_epoch, 1362 steps_per_epoch=steps_per_epoch,

-> 1363 validation_steps=validation_steps) 1364 1365 def evaluate(self,

~\Anaconda3\lib\site-packages\tensorflow\python\keras\engine\training_arrays.py

in fit_loop(model, inputs, targets, sample_weights, batch_size,

epochs, verbose, callbacks, val_inputs, val_targets,

val_sample_weights, shuffle, callback_metrics, initial_epoch,

steps_per_epoch, validation_steps)

262 ins_batch[i] = ins_batch[i].toarray()

263

--> 264 outs = f(ins_batch)

265 if not isinstance(outs, list):

266 outs = [outs]

~\Anaconda3\lib\site-packages\tensorflow\python\keras\backend.py in

call(self, inputs) 2910 feed_symbols != self._feed_symbols or self.fetches != self._fetches or 2911

session != self._session):

-> 2912 self._make_callable(feed_arrays, feed_symbols, symbol_vals, session) 2913 2914 fetched =

self._callable_fn(*array_vals)

~\Anaconda3\lib\site-packages\tensorflow\python\keras\backend.py in

_make_callable(self, feed_arrays, feed_symbols, symbol_vals, session) 2855 callable_opts.target.append(self.updates_op.name) 2856

Create callable.

-> 2857 callable_fn = session._make_callable_from_options(callable_opts) 2858 # Cache

parameters corresponding to the generated callable, so that 2859

we can detect future mismatches and refresh the callable.

~\Anaconda3\lib\site-packages\tensorflow\python\client\session.py in

_make_callable_from_options(self, callable_options) 1412 """ 1413 self._extend_graph()

-> 1414 return BaseSession._Callable(self, callable_options) 1415 1416

~\Anaconda3\lib\site-packages\tensorflow\python\client\session.py in

init(self, session, callable_options) 1366 with errors.raise_exception_on_not_ok_status() as status: 1367

self._handle = tf_session.TF_SessionMakeCallable(

-> 1368 session._session, options_ptr, status) 1369 finally: 1370 tf_session.TF_DeleteBuffer(options_ptr)

~\Anaconda3\lib\site-packages\tensorflow\python\framework\errors_impl.py

in exit(self, type_arg, value_arg, traceback_arg)

517 None, None,

518 compat.as_text(c_api.TF_Message(self.status.status)),

--> 519 c_api.TF_GetCode(self.status.status))

520 # Delete the underlying status object from memory otherwise it stays alive

521 # as there is a reference to status from this from the traceback due to

InvalidArgumentError: Default MaxPoolingOp only supports NHWC on

device type CPU [[Node: max_pooling2d_2/MaxPool =

MaxPoolT=DT_FLOAT,

_class=["loc:@training_3/Adam/gradients/max_pooling2d_2/MaxPool_grad/MaxPoolGrad"],

data_format="NCHW", ksize=[1, 1, 2, 2], padding="VALID", strides=[1,

1, 2, 2],

_device="/job:localhost/replica:0/task:0/device:CPU:0"]]


版权声明:本文为weixin_33918358原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。