本人paddle小白一枚,paddle官方学习平台的情感推荐代码案例,我完全按照里面的操作,但是在训练好模型以后,在测试的时候,使用exe.run的feed喂入数据以后,显示表格的数据错误,卡了两天了,百思不得其解,求大神解答一下
错误代码如下:
infer_movie_id = 783
infer_movie_name = paddle.dataset.movielens.movie_info()[infer_movie_id].title
user_id = fluid.create_lod_tensor([[1]], [[1]], place)
gender_id = fluid.create_lod_tensor([[1]], [[1]], place)
age_id = fluid.create_lod_tensor([[0]], [[1]], place)
job_id = fluid.create_lod_tensor([[10]], [[1]], place)
movie_id = fluid.create_lod_tensor([[783]], [[1]], place) # Hunchback of Notre Dame
category_id = fluid.create_lod_tensor([[10, 8, 9]], [[3]], place) # Animation, Children's, Musical
movie_title = fluid.create_lod_tensor([[1069, 4140, 2923, 710, 988]], [[5]],
place)
place = fluid.CUDAPlace(0) if use_cuda else fluid.CPUPlace()
exe = fluid.Executor(place)
inference_scope = fluid.core.Scope()
with fluid.scope_guard(inference_scope):
[inferencer, feed_target_names,
fetch_targets] = fluid.io.load_inference_model(params_dirname, exe)
results = exe.run(inferencer,
feed={
'user_id': user_id,
'gender_id': gender_id,
'age_id': age_id,
'job_id': job_id,
'movie_id': movie_id,
'category_id': category_id,
'movie_title': movie_title
},
fetch_list=fetch_targets,
return_numpy=False)
predict_rating = np.array(results[0])
报错如下
paddle.fluid.core_avx.EnforceNotMet: Invoke operator lookup_table error.
C++ Callstacks:
Tensor holds the wrong type, it holds int, but desires to be int64_t at [E:\release_cuda87\paddle\paddle/fluid/framework/tensor_impl.h:30]
PaddlePaddle Call Stacks:
Windows not support stack backtrace yet.
https://github.com/PaddlePaddle/Paddle/issues/18615 这个issue已经解决了
之后官网会同步这个修复哈~
不行~~还是报错
您好,请问一下怎么解决的,我安装了对应的版本cuda10.0,cudnn7.3还是报错,至今未找到原因,求解答一下,谢谢
会报这个错误
paddle.fluid.core_avx.EnforceNotMet: Windows not support stack backtrace yet.PaddleCheckError: cudaGetDeviceProperties failed in paddle::platform::GetCUDAComputeCapability, error code : 30, Please see detail in https://docs.nvidia.com/cuda/cuda-runtime-api/group__CUDART__TYPES.html#group__CUDART__TYPES_1g3f51e3575c2178246db0a94a430e0038: unknown error at [D:\1.6.0\paddle\paddle\fluid\platform\gpu_info.cc:84]
请确认一下CUDA的驱动是否安装正确,可以参考:https://github.com/PaddlePaddle/Paddle/issues/17009
这个解决了吗?我在win10里也报这个错误
Win10打开CMD命令行窗口,输入nvcc -V 看看CUDA版本信息,还要确认下cuDNN是否正确安装。最后运行CUDA的官方示例:deviceQuery.exe,看下Result是否PASS。 更新 paddlepaddle-gpu 至最新版本。