首页 PaddleHub 帖子详情
从AI Studio上拷的fine-tune预训练模型的代码,到本地就出现ValueError
收藏
快速回复
PaddleHub 问答预训练模型 576 1
从AI Studio上拷的fine-tune预训练模型的代码,到本地就出现ValueError
收藏
快速回复
PaddleHub 问答预训练模型 576 1

会是什么原因呢?看网上一些说paddle支持'float32'而不支持'float64'导致的,但我也没找着问题出在哪儿。

报错信息:ValueError: (InvalidArgument) The type of data we are trying to retrieve does not match the type of data currently contained in the container.
[Hint: Expected dtype() == paddle::experimental::CppTypeToDataType::Type(), but received dtype():5 != paddle::experimental::CppTypeToDataType::Type():7.] (at ..\paddle\phi\core\dense_tensor.cc:137)
[operator < accuracy > error]

 

0
收藏
回复
全部评论(1)
时间顺序
A
AIStudio10003591
#2 回复于2023-01

有没有具体的代码可以贴一下,看这个报错确实是类型不匹配导致的,你可以试试转换一下输入,比如input放入模型之前,写一行代码,转换成float32的类型。

1
回复
需求/bug反馈?一键提issue告诉我们
发现bug?如果您知道修复办法,欢迎提pr直接参与建设飞桨~
在@后输入用户全名并按空格结束,可艾特全站任一用户