车牌识别,部分错误C++ Call Stacks (More useful to developers):Error Message Summary:

《百度顶会论文复现营》其中作业《车牌识别》部分,运行代码出现错误。
解决方法和原因,在错误信息下面
定义DNN网络如下错误信息如下:

train_pass:0,batch_id:50,train_loss[0.28051484],train_acc:[1.]
train_pass:0,batch_id:100,train_loss[1.2990379],train_acc:[1.]
train_pass:0,batch_id:150,train_loss[0.5766834],train_acc:[1.]
train_pass:0,batch_id:200,train_loss[0.04432668],train_acc:[1.]
train_pass:0,batch_id:250,train_loss[2.531902],train_acc:[0.]
train_pass:0,batch_id:300,train_loss[0.03859062],train_acc:[1.]
train_pass:0,batch_id:350,train_loss[1.3039756],train_acc:[1.]
train_pass:0,batch_id:400,train_loss[0.09336647],train_acc:[1.]
---------------------------------------------------------------------------EnforceNotMet                             Traceback (most recent call last)<ipython-input-6-77c28d4d8993> in <module>
     10             labels = np.array([x[1] for x in data]).astype('int64')
     11             labels = labels[:,np.newaxis]
---> 12             image = fluid.dygraph.to_variable(images)
     13             label = fluid.dygraph.to_variable(labels)
     14 
</opt/conda/envs/python35-paddle120-env/lib/python3.7/site-packages/decorator.py:decorator-gen-153> 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)
    214         assert in_dygraph_mode(
    215         ), "We Only support %s in imperative mode, please use fluid.dygraph.guard() as context to run it in imperative Mode" % func.__name__
--> 216         return func(*args, **kwargs)
    217 
    218     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)
    565                 persistable=False,
    566                 zero_copy=zero_copy,
--> 567                 name=name if name else '')
    568             return py_var
    569     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*&&, 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:
----------------------
ExternalError:  Cuda error(4), unspecified launch failure.
  [Advise: An exception occurred on the device while executing a kernel. Common causes include dereferencing an invalid device pointerand accessing out of bounds shared memory. The device cannot be used until cudaThreadExit() is called. All existing device memory allocations are invalid and must be reconstructed if the program is to continue usingCUDA.] at (/paddle/paddle/fluid/platform/gpu_info.cc:281)

值得说明的是:此问题不一定只出现在车牌识别案例中

原因:首先,车牌识别的样本标签共计65个,但是要注意我们的运行环境是在百度AI Studio下运行,出现此问题说明结果越界(比较像数组超出长度),
在定义DNN网络结构时:self.hidden4 = Linear(100,65,act=‘softmax’)
65代表输出结果的标签数是65,但是实际上标签的个数是66个Why?
注意我们的运行环境是在百度AI Studio下运行,车牌数据集在解压之后会出现两个无用文件夹,一是_MacOS文件夹通常在生成训练列表时会被删除,二是一个隐藏文件夹.ipynb_checkpoints,生成标签文件时,会将它统计其中,导致标签数由65变为66
解决方法:self.hidden4 = Linear(100,65,act=‘softmax’)改为self.hidden4 = Linear(100,66,act=‘softmax’)
也就是65改成66

take effect, and it will only be applied to other Parameters! E:\PaddleX\paddle\fluid\executor.py:1070: UserWarning: The following exception is not an EOF exception. Process Process-1:2: Traceback (most recent call last): File "multiprocessing\process.py", line 297, in _bootstrap File "multiprocessing\process.py", line 99, in run File "paddlexui\pms\model_tasks\tasks.py", line 68, in _call_paddlex_train File "paddlexui\pms\model_tasks\train\detection.py", line 203, in train File "site-packages\paddlex\cv\models\yolo_v3.py", line 171, in train File "site-packages\paddlex\cv\models\ppyolo.py", line 362, in train File "site-packages\paddlex\cv\models\base.py", line 493, in train_loop File "site-packages\paddle\fluid\executor.py", line 1071, in run File "site-packages\six.py", line 703, in reraise File "site-packages\paddle\fluid\executor.py", line 1066, in run File "site-packages\paddle\fluid\executor.py", line 1156, in _run_impl File "site-packages\paddle\fluid\compiler.py", line 443, in _compile File "site-packages\paddle\fluid\compiler.py", line 396, in _compile_data_parallel paddle.fluid.core_avx.EnforceNotMet: -------------------------------------------- C++ Call Stacks (More useful to developers): -------------------------------------------- Windows not support stack backtrace yet. ---------------------- Error Message Summary: ---------------------- PermissionDeniedError: Your machine has multiple cards, but the WITH_NCCL option is not turned on during compilation, and you cannot use multi-card training or prediction. Please recompile and turn on the WITH_NCCL option. [Hint: Expected places.size() == 1, but received places.size():6 != 1:1.] at (D:\1.8.4\paddle\paddle\fluid\framework\parallel_executor.cc:480)
最新发布
06-02
-------------------------------------------- C++ Call Stacks (More useful to developers): -------------------------------------------- Windows not support stack backtrace yet. ------------------------------------------ Python Call Stacks (More useful to users): ------------------------------------------ File "/data/yourenchun/share/projects/renzheng/liuyi/liuyi_env/Python-2.7.14/lib/python2.7/site-packages/paddle/fluid/framework.py", line 1843, in append_op attrs=kwargs.get("attrs", None)) File "/data/yourenchun/share/projects/renzheng/liuyi/liuyi_env/Python-2.7.14/lib/python2.7/site-packages/paddle/fluid/layer_helper.py", line 43, in append_op return self.main_program.current_block().append_op(*args, **kwargs) File "/data/yourenchun/share/projects/renzheng/liuyi/liuyi_env/Python-2.7.14/lib/python2.7/site-packages/paddle/fluid/layers/nn.py", line 9597, in relu6 attrs={'threshold': threshold}) File "/data/yourenchun/share/projects/renzheng/slurm/dist_arcface/models/mnasnet.py", line 171, in conv_bn_layer return fluid.layers.relu6(bn) File "/data/yourenchun/share/projects/renzheng/slurm/dist_arcface/models/mnasnet.py", line 198, in inverted_residual_unit name=name + '_expand') File "/data/yourenchun/share/projects/renzheng/slurm/dist_arcface/models/mnasnet.py", line 252, in invresi_blocks name=name + '_' + str(i + 1)) File "/data/yourenchun/share/projects/renzheng/slurm/dist_arcface/models/mnasnet.py", line 110, in net name='conv' + str(i)) File "test.py", line 107, in run emb = model.net(image) File "test.py", line 318, in main testor.run() File "test.py", line 323, in <module> main() ---------------------- Error Message Summary: ---------------------- Error: Fail to allocate CPU memory: size = 114987136 . [Hint: p should not be null.] at (E:\Paddle\paddle\fluid\memory\detail\system_allocator.cc:61) [operator < relu6 > error]
07-12
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值