InvalidArgumentError (see above for traceback): Cannot parse tensor from proto: dtype: DT_FLOAT

今天运行一个深度学习任务竟然报了这么长的错。

查了一些资料还没有解决,难道是内存太小?

运行的同时打开任务管理器发现内存并没有达到100%就报错了。

来一位大神帮帮我吧。

 

 

python D:\TIANCHI\code\al1.py
Using TensorFlow backend.
(x_train.shape: (144, 1920, 2560)
(y_train.shape: (144,)
(x_test.shape: (24, 1920, 2560)
(y_test.shape: (24,)
x_train shape: (144, 1920, 2560, 1)
144 train samples
24 test samples
_________________________________________________________________
Layer (type)                 Output Shape              Param #
=================================================================
conv2d_1 (Conv2D)            (None, 1621, 2261, 32)    2880032
_________________________________________________________________
conv2d_2 (Conv2D)            (None, 1619, 2259, 64)    18496
_________________________________________________________________
max_pooling2d_1 (MaxPooling2 (None, 809, 1129, 64)     0
_________________________________________________________________
dropout_1 (Dropout)          (None, 809, 1129, 64)     0
_________________________________________________________________
flatten_1 (Flatten)          (None, 58455104)          0
_________________________________________________________________
dense_1 (Dense)              (None, 128)               -110768115
_________________________________________________________________
dropout_2 (Dropout)          (None, 128)               0
_________________________________________________________________
dense_2 (Dense)              (None, 12)                1548
=================================================================
Total params: -1,104,781,076.0
Trainable params: -1,104,781,076.0
Non-trainable params: 0.0
_________________________________________________________________
+++++++++++++model.compile+++++++++++++++++
(x_train.shape: (144, 1920, 2560, 1)
(y_train.shape: (144, 12)
(x_test.shape: (24, 1920, 2560, 1)
(y_test.shape: (24, 12)
Train on 144 samples, validate on 24 samples
Epoch 1/5
2018-09-27 23:51:06.255010: W C:\tf_jenkins\home\workspace\rel-win\M\windows\PY\35\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX instructions, but these are available on your machine and could speed up CPU computations.
2018-09-27 23:51:06.274977: W C:\tf_jenkins\home\workspace\rel-win\M\windows\PY\35\tensorflow\core\platform\cpu_feature_guard.cc:45] The TensorFlow library wasn't compiled to use AVX2 instructions, but these are available on your machine and could speed up CPU computations.
2018-09-27 23:51:06.789561: W C:\tf_jenkins\home\workspace\rel-win\M\windows\PY\35\tensorflow\core\framework\op_kernel.cc:1182] Invalid argument: Cannot parse tensor from proto: dtype: DT_FLOAT
tensor_shape {
  dim {
    size: 58455104
  }
  dim {
    size: 128
  }
}
float_val: 0

2018-09-27 23:51:06.802430: E C:\tf_jenkins\home\workspace\rel-win\M\windows\PY\35\tensorflow\core\common_runtime\executor.cc:644] Executor failed to create kernel. Invalid argument: Cannot parse tensor from proto: dtype: DT_FLOAT
tensor_shape {
  dim {
    size: 58455104
  }
  dim {
    size: 128
  }
}
float_val: 0

         [[Node: Const_9 = Const[dtype=DT_FLOAT, value=<Invalid TensorProto: dtype: DT_FLOAT tensor_shape { dim { size: 58455104 } dim { size: 128 } } float_val: 0>, _device="/job:localhost/replica:0/task:0/cpu:0"]()]]
2018-09-27 23:51:06.874619: W C:\tf_jenkins\home\workspace\rel-win\M\windows\PY\35\tensorflow\core\framework\op_kernel.cc:1182] Invalid argument: Cannot parse tensor from proto: dtype: DT_FLOAT
tensor_shape {
  dim {
    size: 58455104
  }
  dim {
    size: 128
  }
}
float_val: 0

2018-09-27 23:51:06.887917: E C:\tf_jenkins\home\workspace\rel-win\M\windows\PY\35\tensorflow\core\common_runtime\executor.cc:644] Executor failed to create kernel. Invalid argument: Cannot parse tensor from proto: dtype: DT_FLOAT
tensor_shape {
  dim {
    size: 58455104
  }
  dim {
    size: 128
  }
}
float_val: 0

         [[Node: Const_9 = Const[dtype=DT_FLOAT, value=<Invalid TensorProto: dtype: DT_FLOAT tensor_shape { dim { size: 58455104 } dim { size: 128 } } float_val: 0>, _device="/job:localhost/replica:0/task:0/cpu:0"]()]]
2018-09-27 23:51:06.987507: W C:\tf_jenkins\home\workspace\rel-win\M\windows\PY\35\tensorflow\core\framework\op_kernel.cc:1182] Invalid argument: Cannot parse tensor from proto: dtype: DT_FLOAT
tensor_shape {
  dim {
    size: 58455104
  }
  dim {
    size: 128
  }
}
float_val: 0

2018-09-27 23:51:07.001365: E C:\tf_jenkins\home\workspace\rel-win\M\windows\PY\35\tensorflow\core\common_runtime\executor.cc:644] Executor failed to create kernel. Invalid argument: Cannot parse tensor from proto: dtype: DT_FLOAT
tensor_shape {
  dim {
    size: 58455104
  }
  dim {
    size: 128
  }
}
float_val: 0

         [[Node: Const_9 = Const[dtype=DT_FLOAT, value=<Invalid TensorProto: dtype: DT_FLOAT tensor_shape { dim { size: 58455104 } dim { size: 128 } } float_val: 0>, _device="/job:localhost/replica:0/task:0/cpu:0"]()]]
Traceback (most recent call last):
  File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1327, in _do_call
    return fn(*args)
  File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1306, in _run_fn
    status, run_metadata)
  File "C:\ProgramData\Anaconda3\lib\contextlib.py", line 66, in __exit__
    next(self.gen)
  File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\framework\errors_impl.py", line 466, in raise_exception_on_not_ok_status
    pywrap_tensorflow.TF_GetCode(status))
tensorflow.python.framework.errors_impl.InvalidArgumentError: Cannot parse tensor from proto: dtype: DT_FLOAT
tensor_shape {
  dim {
    size: 58455104
  }
  dim {
    size: 128
  }
}
float_val: 0

         [[Node: Const_9 = Const[dtype=DT_FLOAT, value=<Invalid TensorProto: dtype: DT_FLOAT tensor_shape { dim { size: 58455104 } dim { size: 128 } } float_val: 0>, _device="/job:localhost/replica:0/task:0/cpu:0"]()]]

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\TIANCHI\code\al1.py", line 128, in <module>
    validation_data=(x_test, y_test))
  File "C:\ProgramData\Anaconda3\lib\site-packages\keras\models.py", line 845, in fit
    initial_epoch=initial_epoch)
  File "C:\ProgramData\Anaconda3\lib\site-packages\keras\engine\training.py", line 1485, in fit
    initial_epoch=initial_epoch)
  File "C:\ProgramData\Anaconda3\lib\site-packages\keras\engine\training.py", line 1140, in _fit_loop
    outs = f(ins_batch)
  File "C:\ProgramData\Anaconda3\lib\site-packages\keras\backend\tensorflow_backend.py", line 2073, in __call__
    session = get_session()
  File "C:\ProgramData\Anaconda3\lib\site-packages\keras\backend\tensorflow_backend.py", line 153, in get_session
    _initialize_variables()
  File "C:\ProgramData\Anaconda3\lib\site-packages\keras\backend\tensorflow_backend.py", line 306, in _initialize_variables
    sess.run(tf.variables_initializer(uninitialized_variables))
  File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 895, in run
    run_metadata_ptr)
  File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1124, in _run
    feed_dict_tensor, options, run_metadata)
  File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1321, in _do_run
    options, run_metadata)
  File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\client\session.py", line 1340, in _do_call
    raise type(e)(node_def, op, message)
tensorflow.python.framework.errors_impl.InvalidArgumentError: Cannot parse tensor from proto: dtype: DT_FLOAT
tensor_shape {
  dim {
    size: 58455104
  }
  dim {
    size: 128
  }
}
float_val: 0

         [[Node: Const_9 = Const[dtype=DT_FLOAT, value=<Invalid TensorProto: dtype: DT_FLOAT tensor_shape { dim { size: 58455104 } dim { size: 128 } } float_val: 0>, _device="/job:localhost/replica:0/task:0/cpu:0"]()]]

Caused by op 'Const_9', defined at:
  File "D:\TIANCHI\code\al1.py", line 128, in <module>
    validation_data=(x_test, y_test))
  File "C:\ProgramData\Anaconda3\lib\site-packages\keras\models.py", line 845, in fit
    initial_epoch=initial_epoch)
  File "C:\ProgramData\Anaconda3\lib\site-packages\keras\engine\training.py", line 1457, in fit
    self._make_train_function()
  File "C:\ProgramData\Anaconda3\lib\site-packages\keras\engine\training.py", line 1001, in _make_train_function
    self.total_loss)
  File "C:\ProgramData\Anaconda3\lib\site-packages\keras\optimizers.py", line 138, in get_updates
    moments = [K.zeros(shape) for shape in shapes]
  File "C:\ProgramData\Anaconda3\lib\site-packages\keras\optimizers.py", line 138, in <listcomp>
    moments = [K.zeros(shape) for shape in shapes]
  File "C:\ProgramData\Anaconda3\lib\site-packages\keras\backend\tensorflow_backend.py", line 519, in zeros
    return variable(tf.constant_initializer(0., dtype=tf_dtype)(shape),
  File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\ops\init_ops.py", line 203, in __call__
    verify_shape=verify_shape)
  File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\framework\constant_op.py", line 106, in constant
    attrs={"value": tensor_value, "dtype": dtype_value}, name=name).outputs[0]
  File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 2630, in create_op
    original_op=self._default_original_op, op_def=op_def)
  File "C:\ProgramData\Anaconda3\lib\site-packages\tensorflow\python\framework\ops.py", line 1204, in __init__
    self._traceback = self._graph._extract_stack()  # pylint: disable=protected-access

InvalidArgumentError (see above for traceback): Cannot parse tensor from proto: dtype: DT_FLOAT
tensor_shape {
  dim {
    size: 58455104
  }
  dim {
    size: 128
  }
}
float_val: 0

         [[Node: Const_9 = Const[dtype=DT_FLOAT, value=<Invalid TensorProto: dtype: DT_FLOAT tensor_shape { dim { size: 58455104 } dim { size: 128 } } float_val: 0>, _device="/job:localhost/replica:0/task:0/cpu:0"]()]]


C:\WINDOWS\system32>

评论 6
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值