【问题标题】:ValueError: unknown url type with DeepLab demo.ipynbValueError:带有 DeepLab demo.ipynb 的未知 url 类型
【发布时间】:2019-08-15 08:55:45
【问题描述】:

我正在使用 Google Colab 运行 Demo DeepLab.ipnyb。演示提供图像工作良好。当我尝试添加自己的图片时,收到错误“ValueError: unknown url type: '/content/harshu-06032019.png'。我看到文件已上传到 Colab。

感谢任何有关我为什么会收到此错误的帮助。

我尝试将此文件放入 Google 云端硬盘并通过安装 Google 云端硬盘来授予对 Colab 的访问权限。这也行不通。

但如果文件上传到谷歌驱动器,我收到错误“无法检索图像。请检查 url”

这是DeepLabv3+提供的代码

---------------------------------------------------------------------------
ValueError                                Traceback (most recent call last)
<ipython-input-5-ba1edc5ae51a> in <module>()
     24 
     25 image_url = IMAGE_URL or _SAMPLE_URL % SAMPLE_IMAGE
---> 26 run_visualization(image_url)

5 frames
/usr/lib/python3.6/urllib/request.py in _parse(self)
    382         self.type, rest = splittype(self._full_url)
    383         if self.type is None:
--> 384             raise ValueError("unknown url type: %r" % self.full_url)
    385         self.host, self.selector = splithost(rest)
    386         if self.host:

ValueError: unknown url type: '/content/harshu-06032019.png'

【问题讨论】:

    标签: google-colaboratory


    【解决方案1】:

    要修复此“ValueError: unknown url type: '/content/harshu-06032019.png'”,请执行以下步骤:

    1. 从 URL 路径中删除 content
    2. 图片的路径只能是harshu-06032019.png
    3. 运行!ls查看图像文件是否存在

    【讨论】:

      猜你喜欢
      • 2015-09-04
      • 1970-01-01
      • 2022-01-04
      • 1970-01-01
      • 2018-01-02
      • 2021-03-11
      • 1970-01-01
      • 2021-05-11
      • 2018-12-16
      相关资源
      最近更新 更多