0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Sony Neural Network Librariesを使ってハマったこと備忘録

Posted at

Sony Neural Network Librariesを使ってハマったので憂さ晴らしの投稿
先に言うと問題は何も解決してません。

なにはともあれ環境

Windows10
Python v3.10 on VScode
nnabla 1.32.0
nnabla-ext-cuda110 1.32.0

症状

Sony Neural Network Librariesを自前で構築したPython環境にpip install nnablaして使おうとしたが、次のようなことを言われ、にっちもさっちもいかなくなった。

(base) python.exe "nnabla_1.py"
2022-12-23 16:09:33,297 [nnabla][INFO]: Initializing CPU extension...
Traceback (most recent call last):
  File "nnabla_1.py", line 9, in <module>
    import nnabla as nn
  File "C:\Users\hoge\anaconda3\lib\site-packages\nnabla\__init__.py", line 34, in <module>
    from .parameter import (
  File "C:\Users\hoge\anaconda3\lib\site-packages\nnabla\parameter.py", line 29, in <module>
    import nnabla.utils.nnabla_pb2 as nnabla_pb2
  File "C:\Users\hoge\anaconda3\lib\site-packages\nnabla\utils\nnabla_pb2.py", line 5, in <module>
    from google.protobuf.internal import builder as _builder
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 975, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "C:\Users\hoge\anaconda3\lib\site-packages\nnabla\__init__.py", line 34, in <module>
    from .parameter import (
  File "C:\Users\hoge\anaconda3\lib\site-packages\nnabla\parameter.py", line 29, in <module>
    import nnabla.utils.nnabla_pb2 as nnabla_pb2
  File "C:\Users\hoge\anaconda3\lib\site-packages\nnabla\utils\nnabla_pb2.py", line 5, in <module>      
    from google.protobuf.internal import builder as _builder
ImportError: cannot import name 'builder' from 'google.protobuf.internal' (C:\Users\hoge\anaconda3\lib\site-packages\google\protobuf\internal\__inite-packages\google\protobuf\internal\__init__.py) 

pythonのpathgoogle.protobuf.internalなど一通り確認したがどうにも直らない。

解決(してないけど解消はした)

Sony Neural Network Consoleに付属しているPythonを指定して実行すると問題なく動く

私の4時間返せ

付属のPythonはv3.6。問題点はここだったのかもしれないが、私にそれを確かめる元気はない

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?