paddle+rocm4.2 with gfx908

yacmzcpb  于 5个月前  发布在  其他
关注(0)|答案(6)|浏览(82)

请提出你的问题 Please ask your question

Traceback (most recent call last):
File "train.py", line 161, in
use_token_embedding=args.use_token_embedding)
File "train.py", line 108, in init
args.embedding_name, extended_vocab_path=vocab_path)
File "/usr/local/lib/python3.7/site-packages/paddlenlp/embeddings/token_embedding.py", line 113, in init
padding_idx=self._word_to_idx[PAD_TOKEN])
File "/usr/local/lib/python3.7/site-packages/paddle/nn/layer/common.py", line 1347, in init
is_bias=False)
File "/usr/local/lib/python3.7/site-packages/paddle/fluid/dygraph/layers.py", line 412, in create_parameter
default_initializer)
File "/usr/local/lib/python3.7/site-packages/paddle/fluid/layer_helper_base.py", line 374, in create_parameter
**attr._to_kwargs(with_initializer=True))
File "/usr/local/lib/python3.7/site-packages/paddle/fluid/framework.py", line 2920, in create_parameter
initializer(param, self)
File "/usr/local/lib/python3.7/site-packages/paddle/fluid/initializer.py", line 572, in call
stop_gradient=True)
File "/usr/local/lib/python3.7/site-packages/paddle/fluid/framework.py", line 2950, in append_op
kwargs.get("stop_gradient", False))
File "/usr/local/lib/python3.7/site-packages/paddle/fluid/dygraph/tracer.py", line 45, in trace_op
not stop_gradient)
RuntimeError: (NotFound) Operator uniform_random does not have kernel for data_type[float]:data_layout[ANY_LAYOUT]:place[CUDAPlace(0)]:library_type[PLAIN].
[Hint: Expected kernel_iter != kernels.end(), but received kernel_iter == kernels.end().] (at /home/ycy/Paddle-2.1.3/paddle/fluid/imperative/prepared_operator.cc:135)

mcdcgff0

mcdcgff01#

您好,我们已经收到了您的问题,会安排技术人员尽快解答您的问题,请耐心等待。请您再次检查是否提供了清晰的问题描述、复现代码、环境&版本、报错信息等。同时,您也可以通过查看 官网API文档常见问题历史IssueAI社区 来寻求解答。祝您生活愉快~

Hi! We've received your issue and please be patient to get responded. We will arrange technicians to answer your questions as soon as possible. Please make sure that you have posted enough message to demo your request. You may also check out the APIFAQGithub Issue and AI community to get the answer.Have a nice day!

rta7y2nd

rta7y2nd2#

报错提示uniform random OP不支持float类型输入,
检查下报错代码处,初始化时的输入:padding_idx=self._word_to_idx[PAD_TOKEN])

dwbf0jvd

dwbf0jvd3#

执行
python3 -c "import paddle; paddle.utils.run_check()"

Traceback (most recent call last):
File "", line 1, in
File "/usr/local/lib/python3.7/site-packages/paddle/utils/install_check.py", line 196, in run_check
_run_static_single(use_cuda)
File "/usr/local/lib/python3.7/site-packages/paddle/utils/install_check.py", line 124, in _run_static_single
exe.run(startup_prog)
File "/usr/local/lib/python3.7/site-packages/paddle/fluid/executor.py", line 1110, in run
six.reraise(*sys.exc_info())
File "/usr/local/lib/python3.7/site-packages/six.py", line 719, in reraise
raise value
File "/usr/local/lib/python3.7/site-packages/paddle/fluid/executor.py", line 1108, in run
return_merged=return_merged)
File "/usr/local/lib/python3.7/site-packages/paddle/fluid/executor.py", line 1239, in _run_impl
use_program_cache=use_program_cache)
File "/usr/local/lib/python3.7/site-packages/paddle/fluid/executor.py", line 1329, in _run_program
[fetch_var_name])
RuntimeError: In user code:

File "<string>", line 1, in <module>

File "/usr/local/lib/python3.7/site-packages/paddle/utils/install_check.py", line 196, in run_check
  _run_static_single(use_cuda)
File "/usr/local/lib/python3.7/site-packages/paddle/utils/install_check.py", line 118, in _run_static_single
  input, out, weight = _simple_network()
File "/usr/local/lib/python3.7/site-packages/paddle/utils/install_check.py", line 36, in _simple_network
  bias = paddle.create_parameter(shape=[3], dtype="float32")
File "/usr/local/lib/python3.7/site-packages/paddle/fluid/layers/tensor.py", line 138, in create_parameter
  default_initializer)
File "/usr/local/lib/python3.7/site-packages/paddle/fluid/layer_helper_base.py", line 380, in create_parameter
  **attr._to_kwargs(with_initializer=True))
File "/usr/local/lib/python3.7/site-packages/paddle/fluid/framework.py", line 2920, in create_parameter
  initializer(param, self)
File "/usr/local/lib/python3.7/site-packages/paddle/fluid/initializer.py", line 572, in __call__
  stop_gradient=True)
File "/usr/local/lib/python3.7/site-packages/paddle/fluid/framework.py", line 2967, in append_op
  attrs=kwargs.get("attrs", None))
File "/usr/local/lib/python3.7/site-packages/paddle/fluid/framework.py", line 2039, in __init__
  for frame in traceback.extract_stack():

NotFoundError: Operator (uniform_random) does not have kernel for data_type[float]:data_layout[ANY_LAYOUT]:place[CUDAPlace(0)]:library_type[PLAIN].
  [Hint: Expected kernel_iter != kernels.end(), but received kernel_iter == kernels.end().] (at /home/ycy/Paddle-2.1.3/paddle/fluid/framework/operator.cc:1276)
  [operator < uniform_random > error]
cu6pst1q

cu6pst1q4#

你的paddle没有安装成功,请重新安装paddle

并检查报错处输入数据的类型,尝试将float类型转成int32

rxztt3cl

rxztt3cl5#

paddle确定安装成功了,
import paddle
paddle.is_compiled_with_rocm()
True

yebdmbv4

yebdmbv46#

python3 -c $'import paddle\nfor k in paddle.fluid.core._get_all_register_op_kernels()["elementwise_add"]:print(k)'
只有data_type[::paddle::platform::complex128]:data_layout[ANY_LAYOUT]:place[CPUPlace]:library_type[PLAIN]
data_type[int64_t]:data_layout[ANY_LAYOUT]:place[CPUPlace]:library_type[PLAIN]
data_type[::paddle::platform::complex64]:data_layout[ANY_LAYOUT]:place[CPUPlace]:library_type[PLAIN]
data_type[int]:data_layout[ANY_LAYOUT]:place[CPUPlace]:library_type[PLAIN]
data_type[float]:data_layout[ANY_LAYOUT]:place[CPUPlace]:library_type[PLAIN]
data_type[double]:data_layout[ANY_LAYOUT]:place[CPUPlace]:library_type[PLAIN]

但是在build目录下
./paddle/fluid/inference/paddle_inference.dir/elementwise_add_op.objdir/elementwise_add_op.cc.o
./paddle/fluid/inference/paddle_inference.dir/elementwise_add_op.objdir/elementwise_add_op_generated_elementwise_add_op.cu.o
./paddle/fluid/operators/elementwise/CMakeFiles/elementwise_add_op.dir/elementwise_add_op_generated_elementwise_add_op.cu.o
./paddle/fluid/operators/elementwise/CMakeFiles/elementwise_add_op.dir/elementwise_add_op.cc.o
相关的文件应该是编译了的

相关问题