Not able to upload local files in google colab(无法上传Google CoLab中的本地文件)
本文介绍了无法上传Google CoLab中的本地文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试从本地系统上载Google Colboratory中的word2vec文件,并在代码中进一步使用它。
这是我使用的代码。
from google.colab import files
uploaded = files.upload()
每次我执行它时,它都显示以下错误。
仅当单元格已在当前浏览器会话中执行时,上传小部件才可用。请重新运行此单元格以启用
MessageError Traceback (most recent call last)
<ipython-input-1-292f82be1b7a> in <module>()
1 from google.colab import files
2
----> 3 uploaded = files.upload()`
4
5 for fn in uploaded.keys():
/usr/local/lib/python3.6/dist-packages/google/colab/files.py in upload()
59 result = output.eval_js(
60 'google.colab._files._uploadFiles("{input_id}", "{output_id}")'.format(
---> 61 input_id=input_id, output_id=output_id))
62 files = collections.defaultdict(six.binary_type)
63
/usr/local/lib/python3.6/dist-packages/google/colab/output/_js.py in
eval_js(script, ignore_result)
37 if ignore_result:
38 return
---> 39 return _message.read_reply_from_input(request_id)
40
41
/usr/local/lib/python3.6/dist-packages/google/colab/_message.py in
read_reply_from_input(message_id, timeout_sec)
84 reply.get('colab_msg_id') == message_id):
85 if 'error' in reply:
---> 86 raise MessageError(reply['error'])
87 return reply.get('data', None)
88
MessageError: TypeError: google.colab._files is undefined
为什么会发生这种情况?我该怎么办?
推荐答案
火狐当前正在调查此问题,地址为:https://github.com/googlecolab/colabtools/issues/51。
作为临时解决方法,建议使用Chrome上载文件。
这篇关于无法上传Google CoLab中的本地文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
沃梦达教程
本文标题为:无法上传Google CoLab中的本地文件
猜你喜欢
- 如何在 python3 中将 OrderedDict 转换为常规字典 2022-01-01
- 沿轴计算直方图 2022-01-01
- 分析异常:路径不存在:dbfs:/databricks/python/lib/python3.7/site-packages/sampleFolder/data; 2022-01-01
- 如何在 Python 的元组列表中对每个元组中的第一个值求和? 2022-01-01
- pytorch 中的自适应池是如何工作的? 2022-07-12
- python check_output 失败,退出状态为 1,但 Popen 适用于相同的命令 2022-01-01
- python-m http.server 443--使用SSL? 2022-01-01
- padding='same' 转换为 PyTorch padding=# 2022-01-01
- 使用Heroku上托管的Selenium登录Instagram时,找不到元素';用户名'; 2022-01-01
- 如何将一个类的函数分成多个文件? 2022-01-01
