---
# System prepended metadata

title: 國美主機訓練完畢手動更新步驟

---

# 國美主機訓練完畢手動更新步驟
# 使用主機
```
科博館AI主機

```

## 登入192.168.50.100主機 進入目錄 /home/ubuntu/raisaas/DeepStream-Yolo/person 後操作
```
cd /home/ubuntu/raisaas/DeepStream-Yolo/person
export projectname=person_22_02_04
export usept=best_tmp1.pt
rm *
scp rai@192.83.188.36:/autotrain/runs/train/$projectname/weights/$usept ./best.pt
scp rai@192.83.188.36:/autotrain/tmp/$projectname/$projectname.cfg ./person.cfg
scp rai@192.83.188.36:/autotrain/tmp/$projectname/$projectname.names ./person.names

docker exec person_yolor /bin/bash -c "python3 gen_wts_yolor.py -w ../DeepStream-Yolo/person/best.pt -c ../DeepStream-Yolo/person/person.cfg && mv *.wts ../DeepStream-Yolo/person"
# 編譯
docker exec deepstream_6.0 /bin/bash -c "cd /DeepStream-Yolo && CUDA_VER=11.4 make -C nvdsinfer_custom_impl_Yolo"
docker exec deepstream_6.0 /bin/bash -c "cd /DeepStream-Yolo && rm model_b45_gpu0_fp16.engine && deepstream-app -c deepstream_app_config.txt"
docker exec deepstream_6.0 /bin/bash -c "cd /DeepStream-Yolo && deepstream-app -c deepstream_app_config.txt"




```

## 放入正式機
```
mv ../model_b45_gpu0_fp16.engine ./
cp ../nvdsinfer_custom_impl_Yolo/libnvdsinfer_custom_impl_Yolo.so ./
scp -r ../person ubuntu@192.168.10.3:/home/ubuntu/kafka/deepstream-6.0/sources/apps/sample_apps/deepstream-occupancy-analytics/config

```


/usr/src/ultralytics/runs/detect/person_23_02_22/weights/best.pt
## 測試 v8 
```
# 整理
mkdir person_v8
cp /usr/src/ultralytics/runs/detect/train2/weights/best.pt person_v8
cp /usr/src/ultralytics/data/person_22_02_01_v2/person_22_02_01_v2.cfg person_v8/person.cfg
cp /usr/src/ultralytics/data/person_22_02_01_v2/person_22_02_01_v2.names person_v8/person.names


python3 gen_wts_yoloV8.py -w ./person_v8/best.pt 



scp -r rai@192.83.188.36:/home/ubuntu/kafka/person_v8 ./
scp -r rai@192.83.188.36:/home/ubuntu/kafka/yolov8 ./
scp -r rai@192.83.188.36:/home/ubuntu/kafka/person_yolov8s ./
```



```
screen docker exec deepstream_6.0 /bin/bash -c " cd /opt/nvidia/deepstream/deepstream/sources/apps/sample_apps/deepstream-occupancy-analytics && ./deepstream-test5-analytics -c config/test5_config_file_src_infer_tlt.txt"


screen docker exec deepstream_6.0 /bin/bash -c "cd /DeepStream-Yolo && CUDA_VER=11.4 make -C nvdsinfer_custom_impl_Yolo"
docker exec deepstream_6.0 /bin/bash -c "cd /DeepStream-Yolo && deepstream-app -c deepstream_app_config.txt"
docker exec deepstream_6.0 /bin/bash -c "cd /DeepStream-Yolo && rm model_b45_gpu0_fp16.engine && deepstream-app -c deepstream_app_config.txt"
```
