ShannonAI / service-streamer

Boosting your Web Services of Deep Learning Applications.
Apache License 2.0
1.23k stars 186 forks source link

[bug]cuda_devices设置成(0,)时不生效 #33

Closed starplanet closed 4 years ago

starplanet commented 4 years ago

ManagedModel的set_gpu_id存在bug

    def set_gpu_id(gpu_id=None):
        if gpu_id:
            os.environ["CUDA_VISIBLE_DEVICES"] = str(gpu_id)

判断条件应该为if gpu_id is not None

现在临时解决措施是使用字符串来定义cuda_devices=('0', '1')