cudaMemcpy failed in pad
战神萌九 发布于2020-09 浏览:894 回复:1
0
收藏

LeNet学习作业中, 第一个batchsize用来训练的图片为【128,1,20,20] 但是第二个batchsize纬度为[42,1,20,20]的时候报错。

报错详细信息如下:

 

(128, 1, 20, 20)
[128, 1, 20, 20]
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
train_pass:0,batch_id:50,train_loss:[0.26718235],train_acc:[0.90625]
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
train_pass:0,batch_id:100,train_loss:[6.5805287],train_acc:[0.]
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(128, 1, 20, 20)
(42, 1, 20, 20)

---------------------------------------------------------------------------EnforceNotMet Traceback (most recent call last) in
13 # if batch_id == 0:
14 print(images.shape)
---> 15 image=fluid.dygraph.to_variable(images)
16 label=fluid.dygraph.to_variable(labels)
17 # print(batch_id)
in to_variable(value, name, zero_copy)
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/wrapped_decorator.py in __impl__(func, *args, **kwargs)
23 def __impl__(func, *args, **kwargs):
24 wrapped_func = decorator_func(func)
---> 25 return wrapped_func(*args, **kwargs)
26
27 return __impl__
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/framework.py in __impl__(*args, **kwargs)
205 assert in_dygraph_mode(
206 ), "We Only support %s in Dygraph mode, please use fluid.dygraph.guard() as context to run it in Dygraph Mode" % func.__name__
--> 207 return func(*args, **kwargs)
208
209 return __impl__
/opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/paddle/fluid/dygraph/base.py in to_variable(value, name, zero_copy)
219 persistable=False,
220 zero_copy=zero_copy,
--> 221 name=name if name else '')
222 return py_var
223 elif isinstance(value, (core.VarBase, framework.Variable)):
EnforceNotMet:

--------------------------------------------
C++ Call Stacks (More useful to developers):
--------------------------------------------
0 std::string paddle::platform::GetTraceBackString(char const*&&, char const*, int)
1 paddle::platform::EnforceNotMet::EnforceNotMet(std::__exception_ptr::exception_ptr, char const*, int)
2 paddle::platform::GpuMemcpySync(void*, void const*, unsigned long, cudaMemcpyKind)

----------------------
Error Message Summary:
----------------------
Error: cudaMemcpy failed in paddle::platform::GpuMemcpySync (0x561d9012b4a0 -> 0x7f9164107200, length: 67200) error code : 4, Please see detail in https://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART__TYPES.html#group__CUDART__TYPES_1g3f51e3575c2178246db0a94a430e0038: unspecified launch failure at (/paddle/paddle/fluid/platform/gpu_info.cc:324)

 

详细代码如下。

 

收藏
点赞
0
个赞
共1条回复 最后由战神萌九回复于2020-10
#2战神萌九回复于2020-10

什么都没动。

今天重新开程序调试,这个问题就没了。

难道是内存超限了??

0
TOP
切换版块