如何在colab中安装tensorflow_examples

wbrvyc0a  于 2023-05-01  发布在  其他
关注(0)|答案(1)|浏览(126)

我在Google Colab中运行Image segmentation in Tensorflow Core tutorial。跑步时

!pip install git+https://github.com/tensorflow/examples.git

得到错误

Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/
Collecting git+https://github.com/tensorflow/examples.git
  Cloning https://github.com/tensorflow/examples.git to /tmp/pip-req-build-u7_jdkn8
  Running command git clone --filter=blob:none --quiet https://github.com/tensorflow/examples.git /tmp/pip-req-build-u7_jdkn8
  Resolved https://github.com/tensorflow/examples.git to commit e3849ccb6d981aad311f0174281c8575d5e21646
  error: subprocess-exited-with-error
  
  × python setup.py egg_info did not run successfully.
  │ exit code: 1
  ╰─> See above for output.
  
  note: This error originates from a subprocess, and is likely not a problem with pip.
  Preparing metadata (setup.py) ... error
error: metadata-generation-failed

× Encountered error while generating package metadata.
╰─> See above for output.

note: This is an issue with the package mentioned above, not pip.
hint: See above for details.

我想使用'tensorflow_examlples',如

from tensorflow_examples.models.pix2pix import pix2pix
du7egjpx

du7egjpx1#

!apt remove git -y # remove any degraded git module
!apt-get install git -y && git clone https://github.com/tensorflow/examples.git # Install git first, then clone.

请参阅: www.example.com

import sys
sys.path.append('/content/examples')

请参阅: www.example.com
然后导入'pix2pix'

from tensorflow_examples.models.pix2pix import pix2pix

相关问题