Local training or running some code, such as using deep learning to process pedestrian recognition videos, is slow, and there is not enough money for hardware or something (for example, bloggers, poor mess, no money for a good computer), consider this time Use some computing platform to run the code.
Bo main contact is tesra platform, link
click on the project after registration Login
Step 1 point upload, selected in step 2 framework of the project, Step 3 Select the network type, select the project file in step 4, Step 5. Click Upload. You can upload the project
. After the upload is complete, click the training platform to enter the training platform.
First click to import the project, and then click Import to import the project just uploaded.
The most important thing is to change the source code of the local run to the precautions for running on the platform. The relative path does not need to be changed. If you use an absolute path, the path of the platform project is'/home/project name/'. If you want to output data, you need to change the output directory to'/home/output'. I want to output video files here. Also change as follows:
first select the .py file to run, and then select the training parameters, you can choose kreas, TensorFlow (1.12 and below, 2.0 can be selected), pytorch, Mxnet, Caffee, etc., the python version, and the number of GPUs can also be selected.
After running, an error was found, as shown in the figure below.
I searched and found that there is a cv2.imshow function that is not commented out. Just comment it out. If you want to see it, attach a link here.
After commenting it out, click Run again to run the code successfully. As shown in the figure below, after the code ran, the video output was successful, much faster than my own laptop.
Remarks:
1. InFlex platform training error can not connect the network, can be solved according to the following methods, students who need to train on the platform, please operate as follows:
Step 1: Compress the data set into ".zip" format and upload it in the root directory of the project.
Step 2: Write the decompression code before calling the data processing related files. This example is written at the beginning of the startup function
The decompression code is:
import zipfile
zobj = zipfile.ZipFile("./data.zip")
zobj.extractall(path="./")
2. A ModuleNotFoundError: No module named ' ***' error occurs when running locally This problem is often prone to occur, to download and configure the corresponding module, here is also the reason for the lack of this package in the platform environment.
Solution
(1). Create a requirements.txt file in the project root directory
(2). Write the missing package name and version. For example, if the opencv-python package is missing, then write
opencv-python==4.1 in requirements.txt . 0.25
(3). Save requirements.txt
(4). Start the project and it will
be very convenient and quick to solve this problem