Nuitka Python Package Deep Learning Pytorch GPU

tags: Python package  pytorch  python  Depth study

background

	This article describes how to pack Python depth learning frameworks in Anaconda; use Yolo-Fastestv2
 For the case, record all packaged processes and adapt to CUDA deployment to other computers.

Environment version

win10——x64
CUDA——10.0
Nuitka—— 0.6.16.4
torch ——1.5.1
torchvision—— 0.6.1
tqdm——4.36.1
opencv_python——4.4.0
torchsummary——1.5.1
numpy——1.16.6

Note: Here the packaging process only involves Torch 1.5.1 is possible to run normally.

Project code structure adjustment

  • hereYolo-FastestV2The project file directory structure is re-adjusted to the following figure structure, which is easy to pack:

  • After the directory structure is adjusted, you need to test the code operation; run Demo.py normally.

Nuitka packaging

  • Nuitka common packaging command
  • It is best to install MINGW64, the installation process is not described here; no packaging process will be downloaded.
  • Ignore this step of installing MingW64- The packaging process will automatically download MINGW64 and other dependence, may not be downloaded, and Baidu link is available here.

Link:
Extraction code: DKDR

After downloading, you can decompressed to C: \ Users ***** \ appdata \ local \ nuitka \ nuitka overlays.

  • Project package
python -m nuitka --mingw64 --standalone  --show-progress --show-memory  --follow-import-to=need --nofollow-imports   ./demo.py
  • Package success will generate 2 folders: demo.dist and demo.build; just leave DEMO.DIST.

Dependence

  • Only the BASE environment is currently supported under Anaconda.
  • Library and model files required for copy programs

Copying the corresponding library from the E: \ ### \ ### \ Anaconda3 \ lib \ site-packages directory; if you need OpenCV, copy the CV2 folder to the corresponding directory.
- As shown below: The red circle portion is copied from Anaconda to Demo.dist; the green circle is a model related file, etc.

Run test

  • The package process is completed, running the Demo.exe program test.
  • Other Computers If you use CUDA, you need to call the GPU acceleration.

Intelligent Recommendation

[Deep Learning Calculation] PyTorch-GPU calculation

Pytorch-GPU calculation GPU calculation GPU version installation View graphics information Computing device `Tensor`'s GPU calculation Model GPU calculation summary GPU calculation So far, we have bee...

Python Deep Learning: Pytorch

Python Deep Learning: Pytorch 1, Zhang Tu Tensor Scale scaler: 0-D Tensor Vector: 1-D Tensor Matrix Matrix: 2-D Tensor … 2, create Tensor 3, Tensor method and attribute Get only one value of th...

Install the pytorch package for deep learning

Today we mainly explain the useAnaconda3inwindos7/8/10 64Install in placePyTorchofCondaPackage; inwindos7,windos8,windos10InstallpytorchIt has always been a concern for everyone. If you want to know w...

Deep learning pytorch environment setup + nvidia driver + cuda + pytorch-gpu

       For dual-graphics notebooks, build pytorch's deep learning framework and use GPUs to speed up operations. In order to install pytorch-gpu, only after installing the nvidia d...

Install the GPU version of TensorFlow, kears, pytorch deep learning framework based on python (anaconda) under Windows

Compare TensorFlow and pytorch: PyTorch is more suitable for rapid prototyping, hobbyists and small projects in research. TensorFlow is more suitable for large-scale scheduling, especially when consid...

More Recommendation

C ++ calls Python file, the deep learning model built by Tensorflow and Pytorch, and cannot use the GPU analysis.

C ++ calls the Python depth learning model, including the model of Tensorflow and Pytorch, etc., and then use GPUs to have problems. Contains C ++ call Python function, C ++ loading model to GPU, GPU ...

Python + Tkinter + Nuitka Package a single executable EXE file

1. Use PY + TK to complete simple graphical script 2. Package into an EXE file using Nuitka Nuitka: The speed is very fast! Compile Python code to C ++ programs, execution is definitely fast, and the ...

Python deep learning (based on PyTorch)

Python deep learning (based on PyTorch) The first part of PyTorch basics One, Numpy basics Generate numpy array-create an array from existing data Directly convert Python's basic data types (such as l...

Python Deep Learning: Pytorch API

Python Deep Learning: Pytorch API 1、nn.Module init Forward: Complete a forward calculation process Nn.Linear (the number of INPUTs, the number of features of Output) 2, optimizer optimizer = optim.Ada...

nuitka package pandas

Create a new Python example Note that after the Conda installation is completed, you need to upgrade the pandas and numpy (the local operation can not be upgraded. After the packaging is wrong, upgrad...

Copyright  DMCA © 2018-2026 - All Rights Reserved - www.programmersought.com  User Notice

Top