In order to reduce the cost of computing power for front-end engineers using Pipcook, we supported the use of Pipcook training models on Google Colab in August.Google Colab is a Juypter Notebook service provided by Google, which can use free GPU/TPU resources.Let’s start the Step by Step of this article!Create a new Google Colab on Google Drive. Opening the link will create a new *.ipynb file on your Google Drive.Next is environment preparation. Just execute the following code in the code block in Notebook:!wget -P /tmp https://nodejs.org/dist/v12.18.1/node-v12.18.1-linux-x64.tar.xz !rm -rf /usr/local/lib/nodejs !mkdir -p /usr/local/lib/nodejs !tar -xJf /tmp/node-v12.18.1-linux-x64.tar.xz -C /usr/local/lib/nodejs !sh -c 'echo "export PATH=/usr/local/lib/nodejs/node-v12.18.1-linux-x64/bin:\$PATH" >> /etc/profile' !rm -f /usr/bin/node !rm -f /usr/bin/npm !ln -s /usr/local/lib/nodejs/node-v12.18.1-linux-x64/bin/node /usr/bin/node !ln -s /usr/local/lib/nodejs/node-v12.18.1-linux-x64/bin/npm /usr/bin/npm !npm config delete registry import os PATH_ENV = os.environ['PATH'] %env PATH=/usr/local/lib/nodejs/node-v12.18.1-linux-x64/bin:${PATH_ENV} Since Juypter Notebook generally only provides a specific Python environment, the above script is to install the Node.js environment.After preparing the Node.js environment, you can install Pipcook Cli.!npm install @pipcook/pipcook-cli -g !rm -f /usr/bin/pipcook !ln -s /usr/local/lib/nodejs/node-v12.18.1-linux-x64/bin/pipcook /usr/bin/pipcook After the installation is successful, start the daemon:!sudo pipcook init !sudo pipcook daemon start After the startup is successful, you can use Pipcook to train the model you want. We have prepared two sets of Google Colab tutorials for UI component recognition:Classify images of UI componentsDetect the UI components from a design draftHow to switch Google Colab to GPU/TPU?In the process of using Google Colab, the CPU machine is used by default, so how to switch to GPU and TPU?https://preview.redd.it/ngzjimfvp0l51.jpg?width=530&format=pjpg&auto=webp&s=d7be2a2513854a1376afe8b8232f6fccaa07fbd7As shown in the figure above, after entering Google Colab, click Runtime> Change runtime type:https://preview.redd.it/p9vxmgvwp0l51.png?width=414&format=png&auto=webp&s=b3fc6f582fa630cbb629764c35b9c0e3487dc406After switching to GPU or TPU in the pop-up prompt box, just save (SAVE).EndWe are convening volunteers to participate in Pipcook to create a Jupyter Notebook that is more suitable for Node.js/Web developers. Interested students are welcome to private me.
Submitted September 04, 2020 at 12:30AM by yorkiefixer
No comments:
Post a Comment