简体   繁体   中英

Google Colab script throws "Transport endpoint is not connected"

I cannot use any bash commands in Google Colab script, it throws me: Transport endpoint is not connected. The problem only occurs in the mounted gdrive (I am using google-drive-ocamlfuse )

For instance, if I type:

>> cd drive/cnn/
[Errno 107] Transport endpoint is not connected: 'drive/cnn/'
>> ls
ls: cannot access '.': Transport endpoint is not connected

I have tried restarting the runtime but no luck.

Has anyone encountered this?

Silly me, I just simply had to unmount and mount the drive again:

!fusermount -u drive
!google-drive-ocamlfuse drive

Alternatively: Terminate the session by going to : Runtime -> Manage Sessions, then Click on terminate for the session. Then you can re-mount the drive. This will resolve the issue.

What i did is run this code>

import pandas as pd
from google.colab import drive

drive.mount('/content/gdrive', force_remount=True)

Then I saw my directory because I had to change the path

and it works to me!!

Goto Runtime on menubar and click on restart runtime option.

Or simply use the shortcut press CTRL + M

尝试恢复出厂设置运行时希望它工作

In my case I was using Pro+ with background execution on.

Drive got refreshed after

1. Disconnect and delete runtime
2. mount

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM