github on all kinds of fun AI project, may be curious to run to try, but for me this kind of white people is very unfriendly, even if you look at the installation instructions to operate in the end can not run successfully, especially windows users, the need for a variety of front installation of all kinds of environments, manually install dependencies, configure the parameters of the file, for the operation of people who do not know the code is very strenuous.
You can try to download Pinokio Deploying all kinds of AI projects, but I've had a lot of problems with Pinokio and it hasn't gone well. So with the next content...
Difficulties in deploying AI projects for white people
- Base dependency environment installation is messed up and can't be fixed
- Not sure how to execute a file with a .py extension
- The project itself does not have a webUI interface and will not operate from the command line
- Hardware constraints prevented the launch of the project
- Requires manual installation of the frontend files (or a separate download of the model to be placed in the project directory after deployment)
- After downloading the project code, you need to configure the parameter file before you can run the program.
- Installation of docker fails for windows users
- Network environment cannot download overseas resources
Reflections on how to address the above issues
- Learn to deploy dependent environments in anaconda; or write a more generalized one-click deployment script for environments, I'll go with the latter.
- Write a one-click deployment script that also solves the problem of running files with a .py extension, as per "1".
- Popular projects usually have webUI branches, try searching for "project name + webui".
- insoluble (i.e. unable to solve)
- Can only look at the official help document, you can enter the document to chatgpt, let him guide you to operate, really do not understand no solution!
- Can only look at the official help document, you can enter the document to chatgpt, let him guide you to operate, really do not understand no solution!
- Learn to install docker, windows tutorials can be found, the core is to install Ubuntu in the wsl command, search for related tutorials on their own
- No solution, think of something, or find a domestic mirror...
About One-Click Deployment Scripts
In fact, writing a one-click deployment script to solve the environment + run command problem can cover the vast majority of white people, so our goal is to let the white people as long as you enter a line of simple commands, you can complete a variety of projects python project deployment, and run the AI project, the expected goal is to solve the one-click 60% AI project can be installed smoothly with one click.
Here we start to operate, you first do not have to understand why to do so, follow the step-by-step operation down to say, I use windows system demonstration.
1. First make sure that your computer has winget installed.
Type cmd in "Run" and press enter to open the command line interface, type winget -v to check if winget is installed, and the version number means it has been installed.
Search for "how to install winget" without installing it.
2. Download the script file I provided, unzip it and put it in any English directory.
3. Add the full English directory to the system environment variable
My directory is D:autogit, to add it to the system environment variables, first find the location of the system environment variables and click on "Environment Variables":
Method 1: Win+r, then type sysdm.cpl and press Enter.
Method 2: Type: system environment variables in the search box at the bottom and the
4. Scroll down to find Path and double-click on it
5. Click New, and paste the previously created directory, click to confirm it
6. Check if the system environment variables are set successfully
Open the command line interface, type shell in the search box, find and open "windows powershell" (don't type cmd as it may not start the system environment variables)
If the following figure appears, complementing the command, the environment variable is active
Now that the move to the environment is complete, let's move on to deploying the AI project.
Deployment of AI projects
1. Find the git address of the project and click copy.
2. Select the installation directory of the project, right-click in the directory and click "Open in Terminal".
3. Deployment of new projects
Type ` auto_init_py_git.bat`, tap space, paste the git address you copied earlier, and press enter.
auto_init_py_git.bat: this command downloads the project file and executes the deployment, if you have already downloaded the project file, use the `auto_init_py.bat` command
4. Execute project installation
You will encounter two situations, one is the command line is stuck, a moment on the exit, basically network problems, the default domestic network can not be installed directly, think of ways to do it yourself, for example, the following error interface (there is a messy code, meaning that the exit is installed):
During normal installation, you will see the following screen:
Then jump to the torch installation interface (the installation package is large, you need to wait a little longer):
Note: The installed torch version should be suitable for most projects, some projects need the latest version, you can edit the auto_init_py_git.bat file with notepad, delete the version number in the file and re-execute the installation:
5. found missing python dependency how to deal with
Edit the auto_init_py_git.bat file with Notepad and at the bottom you will find the following:
It means to find that dependency filename from the downloaded git project and install the python dependency according to the contents of the file, let's see if there is such a file in the downloaded git project:
Good thing... Usually the project author provides this file, if not, or if the dependency file is renamed, you need to install the dependency yourself or edit this filename in auto_init_py_git.bat.
6. Enter the following command
pip install -e.
7. Run the startup command
The startup command I found from the help documentation, enter it in the project directory command line and press enter to start it.
What should I do if I get an error after entering the startup command?
Directly copy the entered command and the returned error message to chatgpt to troubleshoot, follow his instructions, usually caused by the lack of basic dependencies. For example
There is also a special kind of error reporting:
Recall the "Difficulty 5" mentioned in the beginning, that is, the deployed project requires you to download the large model separately, and then put it in the project directory, some projects will automatically download the model for the first time, while some projects require you to download it according to the official help file.
Some projects automatically download domestic models when they start and will ask you toClosure of the scientific environmentPlease note.