Google Colab 脚本抛出 "Transport endpoint is not connected"

Google Colab script throws "Transport endpoint is not connected"

我不能在 Google Colab 脚本中使用任何 bash 命令,它抛出我: Transport endpoint is not connected. 问题只发生在安装的 gdrive 中(我正在使用 google-drive-ocamlfuse

例如,如果我键入:

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

我尝试重新启动运行时但没有成功。

有人遇到过吗?

愚蠢的我,我只需要卸载并再次安装驱动器:

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

或者:通过以下方式终止会话:运行时 -> 管理会话,然后单击终止会话。然后您可以重新安装驱动器。这将解决问题。

尝试恢复出厂设置运行时希望它有效

我做的是运行这段代码>

import pandas as pd
from google.colab import drive

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

然后我看到了我的目录,因为我必须更改路径

对我有用!!

转到菜单栏上的运行时并单击重新启动运行时选项。

或者直接使用快捷键 CTRL + M