[Google Colab] OSError: [Errno 107] Transport endpoint is not connected
글 작성자: 만렙개발자
import numpy as np from google.colab import drive drive.mount('/content/drive',force_remount=True) %cd "/content/drive/My Drive/"
이런식으로 force_remount를 했으나, 아래와 같은 장문의 에러가 발생했다.
ERROR:root:Internal Python error in the inspect module. Below is the traceback from this internal error. Mounted at /content/drive Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/IPython/core/interactiveshell.py", line 2882, in run_code exec(code_obj, self.user_global_ns, self.user_ns) File "<ipython-input-19-7add2dbb7e59>", line 4, in <module> get_ipython().magic('cd "/content/drive/My Drive/0_colab/FinML/"') File "/usr/local/lib/python3.6/dist-packages/IPython/core/interactiveshell.py", line 2160, in magic return self.run_line_magic(magic_name, magic_arg_s) File "/usr/local/lib/python3.6/dist-packages/IPython/core/interactiveshell.py", line 2081, in run_line_magic result = fn(*args,**kwargs) File "</usr/local/lib/python3.6/dist-packages/decorator.py:decorator-gen-91>", line 2, in cd File "/usr/local/lib/python3.6/dist-packages/IPython/core/magic.py", line 188, in <lambda> call = lambda f, *a, **k: f(*a, **k) File "/usr/local/lib/python3.6/dist-packages/IPython/core/magics/osm.py", line 288, in cd oldcwd = py3compat.getcwd() OSError: [Errno 107] Transport endpoint is not connected During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/IPython/core/interactiveshell.py", line 1823, in showtraceback stb = value._render_traceback_() AttributeError: 'OSError' object has no attribute '_render_traceback_' During handling of the above exception, another exception occurred: Traceback (most recent call last): File "/usr/local/lib/python3.6/dist-packages/IPython/core/ultratb.py", line 1132, in get_records return _fixed_getinnerframes(etb, number_of_lines_of_context, tb_offset) File "/usr/local/lib/python3.6/dist-packages/IPython/core/ultratb.py", line 313, in wrapped return f(*args, **kwargs) File "/usr/local/lib/python3.6/dist-packages/IPython/core/ultratb.py", line 358, in _fixed_getinnerframes records = fix_frame_records_filenames(inspect.getinnerframes(etb, context)) File "/usr/lib/python3.6/inspect.py", line 1490, in getinnerframes frameinfo = (tb.tb_frame,) + getframeinfo(tb, context) File "/usr/lib/python3.6/inspect.py", line 1448, in getframeinfo filename = getsourcefile(frame) or getfile(frame) File "/usr/lib/python3.6/inspect.py", line 696, in getsourcefile if getattr(getmodule(object, filename), '__loader__', None) is not None: File "/usr/lib/python3.6/inspect.py", line 725, in getmodule file = getabsfile(object, _filename) File "/usr/lib/python3.6/inspect.py", line 709, in getabsfile return os.path.normcase(os.path.abspath(_filename)) File "/usr/lib/python3.6/posixpath.py", line 383, in abspath cwd = os.getcwd() OSError: [Errno 107] Transport endpoint is not connected ---------------------------------------------------------------------------
[Errno 107] Transport endpoint is not connected 에러를 해결하는 방법들을 찾아보았다.
1. unmount하고 mount를 다시하는 방식이다.
!fusermount -u drive
!google-drive-ocamlfuse drive
하지만, 경우에 따라 아래와 같이 여전히 endpoint 문제로 에러가 발생할 수 있다.
shell-init: error retrieving current directory: getcwd: cannot access parent directories: Transport endpoint is not connected fusermount: bad mount point drive: Transport endpoint is not connected shell-init: error retrieving current directory: getcwd: cannot access parent directories: Transport endpoint is not connected /bin/bash: google-drive-ocamlfuse: command not found
2. drive timeout 문제
드라이브의 루트 Directory (/ content / gdrive / My Drive)에 많은 파일이 있는게 문제라고 합니다.
물론.. 파일이 많긴 한데...;; ㅠㅠ
ref: https://github.com/googlecolab/colabtools/issues/284
ref: https://research.google.com/colaboratory/faq.html#drive-timeout
루트 폴더 정리하기 or
그냥 런타임 초기화, drive mount authorization 다시 하기
저는 런타임 초기화 하고 drive mount authorization 다시 했더니 됩니다...
timeout이 자주 생기지 않기를 ... ㅠ
'✏️ 수동로깅 > dev_log' 카테고리의 다른 글
Kafka Consumer to insert mongoDB in python (0) | 2020.06.16 |
---|---|
[opencv] ImportError: libSM.so.6: cannot open shared object file: No such file or directory (0) | 2020.03.15 |
[파이썬] inspect 모듈의 getsource() 함수- 도큐멘테이션을 안보고 함수 구현부를 빠르게 확인하기 (0) | 2020.02.24 |
[파이썬] python subprocess 가 에러 메세지도 없이 죽었다/사라졌다 dmesg (0) | 2020.02.20 |
Jupyter Lab에서 VS Code로 개발환경 이전 (0) | 2020.02.14 |
댓글
이 글 공유하기
다른 글
-
Kafka Consumer to insert mongoDB in python
Kafka Consumer to insert mongoDB in python
2020.06.16 -
[opencv] ImportError: libSM.so.6: cannot open shared object file: No such file or directory
[opencv] ImportError: libSM.so.6: cannot open shared object file: No such file or directory
2020.03.15 -
[파이썬] inspect 모듈의 getsource() 함수- 도큐멘테이션을 안보고 함수 구현부를 빠르게 확인하기
[파이썬] inspect 모듈의 getsource() 함수- 도큐멘테이션을 안보고 함수 구현부를 빠르게 확인하기
2020.02.24Kaggle의 커널을 리뷰하다가 흥미로운 패키지를 발견했습니다. inspect 패키지인데, 설치는 간단히 pip로 가능합니다. pip install inspect inspect 모듈의 기능은 모듈, 클래스, 함수에대한 정보를 얻는 것입니다. 좀 더 깊이 보면 기능이 다양하지만, 가장 간단한 기능 하나만으로도 매우 유용합니다. 여기서 소개하고자 하는 함수는 getsource() 함수이다. 함수의 구현부 소스코드를 가져옵니다. import inspect from keras.utils import to_categorical print(inspect.getsource(to_categorical)) keras.utils에 있는 to_categorical 코드를 살펴봅시다. 출력 결과는 다음과 같습니다. def t… -
[파이썬] python subprocess 가 에러 메세지도 없이 죽었다/사라졌다 dmesg
[파이썬] python subprocess 가 에러 메세지도 없이 죽었다/사라졌다 dmesg
2020.02.20
댓글을 사용할 수 없습니다.