Google Colab use of error-prone summary

Google Colab use of error-prone summary

Normal procedure

For example to SiamFC ++

important point

1. Be sure to pay attention to choose the operating environment! ! ! Otherwise, the back of the work done for nothing

2. Use the command in colab Note escaped spaces

!python /content/drive/My\ Drive/BertNer/BERT_NER.py 

3.colab run directory is / content / drive / My Drive

Pay special attention to the current working directory, use the following command into the current directory

%cd /content/gdrive/My\ Drive/yourfilename

4. How do you change tensorflow version on colab

View the current version

!pip3 show tensorflow

Method One: If you want to 2.x version (currently colab default 2.x) into 1.x (in this way can only switch between 1.x and 2.x)

%tensorflow_version 1.x
import tensorflow as tf
tf.__version__

Method two: with Native Command Line

!pip uninstall tensorflow
!pip install tensorflow==1.11

Note: After the above two methods to use to complete, must restart the runtime, the command is as follows:

import os
os.kill(os.getpid(), 9)

5.colab neither new folder, save it to a file output path should pay attention to remove the folder

#out = cv2.VideoWriter('./output/'+args["input"][43:57]+ "_" + args["class"] + '_output.avi', fourcc, 15, (w, h))

out = cv2.VideoWriter('./'+args["input"][43:57]+ "_" + args["class"] + '_output.avi', fourcc, 15, (w, h))

6.Cannot connect to X server GOOGLE COLAB how to do?

Can not connect to X server GOOGLE COLAB
short: comment out all outputs (such as cv.imshow, etc.), to save the converted file

Other error-prone point summary

https://zhuanlan.zhihu.com/p/98210226
https://www.jianshu.com/p/a42d69568966
https://zhuanlan.zhihu.com/p/105647700
https://zhuanlan.zhihu.com/p/89311070?utm_source=wechat_session

Welcome to point out any errors (this document is continuously updated)

Guess you like

Origin www.cnblogs.com/icodes8238/p/12636186.html