We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
我有两张显卡,我在学习ernie_skep_sentiment_analysis预测代码示例:
import paddlehub as hub module = hub.Module(name="ernie_skep_sentiment_analysis")
test_texts = ['你不是不聪明,而是不认真', '虽然小明很努力,但是他还是没有考100分'] results = module.predict_sentiment(test_texts, use_gpu=False)
for result in results: print(result['text']) print(result['sentiment_label']) print(result['positive_probs']) print(result['negative_probs'])
我想在代码示例中加入显卡指定,好像不能通过os.environ["CUDA_VISIBLE_DEVICES"]="1"来指定运行显卡。
另外我也尝试修改了model.py 中的 _places = os.environ["CUDA_VISIBLE_DEVICES"] int(_places[0])
也不能指定显卡。
请问要怎么做才能够在预测代码示例中加入指定显卡?
The text was updated successfully, but these errors were encountered:
wj-Mcat
No branches or pull requests
我有两张显卡,我在学习ernie_skep_sentiment_analysis预测代码示例:
import paddlehub as hub
module = hub.Module(name="ernie_skep_sentiment_analysis")
test_texts = ['你不是不聪明,而是不认真', '虽然小明很努力,但是他还是没有考100分']
results = module.predict_sentiment(test_texts, use_gpu=False)
for result in results:
print(result['text'])
print(result['sentiment_label'])
print(result['positive_probs'])
print(result['negative_probs'])
我想在代码示例中加入显卡指定,好像不能通过os.environ["CUDA_VISIBLE_DEVICES"]="1"来指定运行显卡。
另外我也尝试修改了model.py 中的
_places = os.environ["CUDA_VISIBLE_DEVICES"]
int(_places[0])
也不能指定显卡。
请问要怎么做才能够在预测代码示例中加入指定显卡?
The text was updated successfully, but these errors were encountered: