Last update at :2024-05-07,Edit by888u
This article is a simple introduction to the use of Colaboratory. After reading this article, you can simply use Colaboratory, for example, to learn the Ubuntu operating system. But if you want to learn more about Colaboratory, such as machine learning, crawlers, etc., please check the official documentation yourself and conduct in-depth study of python (or other programming languages) first.
Chinese say from Google: https://colab.research.google.com/notebook
The official description is:
Colaboratory is a research project and is free to use.
Free GPU! Free GPU! Free GPU!
Although not sure if this project is permanent
Below is the usage tutorial
Must use Google Chrome! !
Must use Google Chrome! !
This tutorial is divided into two parts
1. Apply for Colaboratory
2. Set up Colaboratory
1. Apply for Colaboratory
1. Enter Google Cloud Drive (https://drive.google.com/drive/my-drive). Since Colab relies on Google Cloud Drive, you need to create a new folder on the cloud drive.
3. After the creation is completed, a jupyter notebook will be automatically generated.
4. Double-click the application to run
2. Using Colaboratory
1. Set up GPU operation and select Modify -> Laptop Settings
2. Set the hardware accelerator to GPU
At this time, you can run some ubuntu commands. Remember to add the English [! 】The following content is purely for records, there is no need to read further.
Of course, you have to install some necessary software first, such as wget, CURL, etc.
At this point, you can already install some software or perform calculations according to your own needs. You can also install ftp and then transfer data. First, wget the data to be processed into the Colaboratory. After the processing is completed, use the ftp command to transfer it to other places.
At this point you already have an ubuntu server with powerful computing power and it is connected to the Internet. You can do many things. Please refer to the usage tutorials of various vps.
3. Install the necessary libraries, enter the corresponding code, and execute (crtl+F9)
!apt-get install -y -qq software-properties-common python-software-properties module-init-tools
!add-apt-repository -y ppa:alessandro-strada/ppa 2>&1 > /dev/null
!apt-get update -qq 2>&1 > /dev/null
!apt-get -y install -qq google-drive-ocamlfuse fuse
from google.colab import auth
auth.authenticate_user()
from oauth2client.client import GoogleCredentials
creds = GoogleCredentials.get_application_default()
import getpass
!google-drive-ocamlfuse -headless -id={creds.client_id} -secret={creds.client_secret} < /dev/null 2>&1 | grep URL
vcode = getpass.getpass()
!echo {vcode} | google-drive-ocamlfuse -headless -id={creds.client_id} -secret={creds.client_secret}
After running, a prompt similar to the following will appear
First click on the corresponding link, select your Google account, and allow it. Finally, you will get the corresponding code.
4. Mount the cloud drive, enter the following command and execute it
!mkdir -p drive
!google-drive-ocamlfuse drive -o nonempty
5. Install Keras
!pip install -q keras
Recommended site searches: virtual host evaluation, US php host, website ip address query, query ip address, view ip, cm domain name, anti-complaint vps host, Yangzhou dual-line server, cc domain name, apply for free space and domain names,
发表评论