Coder Social home page Coder Social logo

practical-ml-vision-book-ja's People

Contributors

takumiohym avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

practical-ml-vision-book-ja's Issues

Google collaboratoryで04ab_retinanet_arthropods.ipynbを実行するとエラーがでます

!pip install tf-models-official==2.9.2
を実行しようとするとエラーが出ます。

エラーコードを見ると、tf-models-official のインストール時に pyyaml の特定のバージョン(>=5.1,<6.0)が必要とされていますが、それをビルドする際に問題が発生しているようでした。

試したこととしては、以下のコードでpyyamlのバージョンを指定しましたが、うまく行きませんでした。
!pip install 'pyyaml>=5.1,<6.0'

また以下のコードでpyyamlの代わりにruamel.yamlを使用することを試してみましたが、同様にうまく行きませんでした。
!pip install ruamel.yaml
import sys
import ruamel.yaml
sys.modules['pyyaml'] = ruamel.yaml

お手数ですが、解説法をご教授頂けると幸いです。

エラー全文を以下に掲載します。

Collecting pyyaml<6.0,>=5.1 (from tf-models-official==2.9.2)
Using cached PyYAML-5.4.1.tar.gz (175 kB)
Installing build dependencies ... done
error: subprocess-exited-with-error

× Getting requirements to build wheel 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.
Getting requirements to build wheel ... error
error: subprocess-exited-with-error

× Getting requirements to build wheel 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.

Modify training code to accelerator agnostic way

Each training code assuming some environment.

Introduce accelerator check to work on various environment.

# Detect accelerator type
try: # detect TPUs
    tpu = tf.distribute.cluster_resolver.TPUClusterResolver.connect()
    strategy = tf.distribute.TPUStrategy(tpu)
except ValueError: # detect GPUs or multi-GPU machines
    strategy = tf.distribute.MirroredStrategy()

...

# Setup different variables based on accelerators.
if type(strategy) == tf.distribute.MirroredStrategy:
    ... # GPU setup
elif type(strategy) == tf.distribute.TPUStrategy:
    ... # TPU setup

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.