错误提示:
Traceback (most recent call last):
File "train01.py", line 243, in
model = MyCNN()
File "train01.py", line 198, in __init__
self.conv1 = Conv2D(in_channels=in_c, out_channels=18, kernel_size=3)
File "/root/anaconda3/lib/python3.8/site-packages/paddle/nn/layer/conv.py", line 633, in __init__
super(Conv2D, self).__init__(
File "/root/anaconda3/lib/python3.8/site-packages/paddle/nn/layer/conv.py", line 132, in __init__
self.weight = self.create_parameter(
File "/root/anaconda3/lib/python3.8/site-packages/paddle/fluid/dygraph/layers.py", line 411, in create_parameter
return self._helper.create_parameter(temp_attr, shape, dtype, is_bias,
File "/root/anaconda3/lib/python3.8/site-packages/paddle/fluid/layer_helper_base.py", line 369, in create_parameter
return self.main_program.global_block().create_parameter(
File "/root/anaconda3/lib/python3.8/site-packages/paddle/fluid/framework.py", line 3193, in create_parameter
initializer(param, self)
File "/root/anaconda3/lib/python3.8/site-packages/paddle/fluid/initializer.py", line 353, in __call__
op = block.append_op(
File "/root/anaconda3/lib/python3.8/site-packages/paddle/fluid/framework.py", line 3219, in append_op
_dygraph_tracer().trace_op(type,
File "/root/anaconda3/lib/python3.8/site-packages/paddle/fluid/dygraph/tracer.py", line 43, in trace_op
self.trace(type, inputs, outputs, attrs,
NotImplementedError: (Unimplemented) Place CUDAPlace(0) is not supported. Please check that your paddle compiles with WITH_GPU, WITH_XPU or WITH_ASCEND_CL option or check that your train process set the correct device id if you use Executor. (at /paddle/paddle/fluid/platform/device_context.cc:88)
[operator < gaussian_random > error]
INFO 2021-06-19 03:25:03,611 launch_utils.py:327] terminate all the procs
ERROR 2021-06-19 03:25:03,611 launch_utils.py:582] ABORT!!! Out of all 1 trainers, the trainer process with rank=[0] was aborted. Please check its log.
INFO 2021-06-19 03:25:06,614 launch_utils.py:327] terminate all the procs
根据 “NotImplementedError: (Unimplemented) Place CUDAPlace(0) is not supported. ” 这一句,大概是没有安装gpu版本的paddle么?可以根据官网 安装下GPU版本的试试:https://www.paddlepaddle.org.cn/install/quick?docurl=/documentation/docs/zh/install/pip/linux-pip.html