半精度(fp16)训练模型优化器更新参数产生报错
收藏
报错信息如下:
(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():10 != paddle::experimental::CppTypeToDataType::Type():12.] (at /paddle/paddle/phi/core/dense_tensor.cc:137)
[operator < adam > error]
在optimizer.step()处出现报错
已打断点确认过loss, model, 和optimizer本身的数据类型均为float16,但还是会莫名其妙报这个数据类型不匹配错误
0
收藏
请登录后评论
你要不看看我的项目?
嗯?给个Github链接?
https://aistudio.baidu.com/aistudio/projectdetail/1338814?contributionType=1&shared=1