1 Star 0 Fork 0

qiqiqi777/LibFewShot

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
run_test.py 752 Bytes
一键复制 编辑 原始数据 按行查看 历史
yangcedrus 提交于 2021-12-02 05:09 . fix using wrong gpu bug
# -*- coding: utf-8 -*-
import sys
sys.dont_write_bytecode = True
import os
import torch
from core.config import Config
from core import Test
PATH = "./results/DN4-miniImageNet--ravi-Conv64F-5-1-Dec-01-2021-06-05-20"
VAR_DICT = {
"test_epoch": 5,
"device_ids": "4,5",
"n_gpu": 2,
"test_episode": 600,
"episode_size": 2,
}
def main(rank, config):
test = Test(rank, config, PATH)
test.test_loop()
if __name__ == "__main__":
config = Config(os.path.join(PATH, "config.yaml"), VAR_DICT).get_config_dict()
if config["n_gpu"] > 1:
os.environ["CUDA_VISIBLE_DEVICES"] = config["device_ids"]
torch.multiprocessing.spawn(main, nprocs=config["n_gpu"], args=(config,))
else:
main(0, config)
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/qiqiqi777/LibFewShot.git
git@gitee.com:qiqiqi777/LibFewShot.git
qiqiqi777
LibFewShot
LibFewShot
FRN

搜索帮助