Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

extract_aspects_chinese.py 默认在GPU上运行出现的问题 #58

Closed
SongShihao731 opened this issue Aug 16, 2021 · 10 comments
Closed
Labels
good first issue Good for newcomers

Comments

@SongShihao731
Copy link

SongShihao731 commented Aug 16, 2021

###测试反馈
您好,在您的示例extract_aspects_chinese.py 中代码中:
aspect_extractor = ATEPCCheckpointManager.get_aspect_extractor(checkpoint='lcf_atepc_cdw_apcacc_95.2_apcf1_94.28_atef1_90.49')默认会使用GPU进行处理,但这会导致一个错误 ValueError: could not convert string to float: '[N/A]' 出现问题的文件是auto.py.如果默认不使用GPU而使用CPU则示例代码正常:
aspect_extractor = ATEPCCheckpointManager.get_aspect_extractor(checkpoint='lcf_atepc_cdw_apcacc_95.2_apcf1_94.28_atef1_90.49',auto_device=False)
本机运行环境有 2060,CUDA也安装调试完成。
感谢您高频率的维护代码~ cool

@yangheng95
Copy link
Owner

您能贴出代码错误的trace吗

@SongShihao731
Copy link
Author

image

@yangheng95
Copy link
Owner

我注意到这个问题了,autocuda的是采用的GitHub上的开源代码,是通过系统命令nvidia-smi查询cuda,可能你的命令配置有问题。能让我看一下你的环境中该命令的输出吗

@SongShihao731
Copy link
Author

image

@yangheng95
Copy link
Owner

yangheng95 commented Aug 16, 2021

这个输出确实不大一样,不清楚是否是新版本导致的问题。我发布一个补丁,让您可以直接手动指定cuda device,可以吗?
如果确实是nvidia查询结果改版的话,我后面会修改autocuda源码

@SongShihao731
Copy link
Author

麻烦您了

@yangheng95
Copy link
Owner

我发不了1.0.7.1版本,宁可以使用auto_deivce='cuda'指定GPU,请反馈一下测试结果,谢谢!

@SongShihao731
Copy link
Author

代码显示可以正常运行了,感谢您
image

@yangheng95
Copy link
Owner

除此之外您还可以加载完模型后手动切换device: https://github.com/yangheng95/PyABSA/blob/release/examples/common_usages/change_loading_device.py

@SongShihao731
Copy link
Author

谢谢~

@yangheng95 yangheng95 added the good first issue Good for newcomers label Aug 16, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants