onnx模型截断:
onnx.utils.extract_model('onnx/mobilenet_v3_small_shape.onnx', 'onnx/mobilenet_v3_small_shape_truncated.onnx', ['input.1'], ['262'])
onnx.utils.extract_model('yolov7seg.onnx', 'yolov7seg_truncated.onnx', ['images'], ['515', "625", "735", '513'])
onnx.utils.extract_model('onnx/yolov5s.onnx', 'onnx/yolov5s_truncated.onnx', ['images'], ['/model.24/m.0/Conv_output_0', '/model.24/m.1/Conv_output_0', '/model.24/m.2/Conv_output_0'])
onnx模型生成shape信息:
onnx.save(onnx.shape_inference.infer_shapes(onnx.load('yolov5s.onnx')), 'yolov5s_shape.onnx')
hyper-v开关命令:
使用管理员权限运行命令: bcdedit /set hypervisorlaunchtype off
对应的打开Hyper-V的命令: bcdedit /set hypervisorlaunchtype auto
wsl网络映射:
netsh interface portproxy add v4tov4 listenaddress=0.0.0.0 listenport=2222 connectaddress=172.19.163.165 connectport=22
netsh advfirewall firewall add rule name=WSL2 dir=in action=allow protocol=TCP localport=2222
命令行导出代理地址,需先安装clash:
export https_proxy=http://192.168.110.111:7890 http_proxy=http://192.168.110.111:7890 all_proxy=socks5://192.168.110.111:7890
docker启动命令:
docker run -itd --name test_env2 --gpus=all --ipc=host -p 20222:22 -v /mnt/work:/home/michael/work ubuntu:20.04 /bin/bash -c "while true; do echo \'Hello\'; sleep 1000; done"
docker run --rm -it --gpus=all --env=is_half=False -v /mnt/work:/home/michael/work --workdir=/workspace -p 19880:9880 -p 19871:9871 -p 19872:9872 -p 19873:9873 -p 19874:9874 --shm-size="16G" -d breakstring/gpt-sovits:latest