tanreinama / GPTSAN

General-purpose Swich transformer based Japanese language model
MIT License
117 stars 4 forks source link

protobuf の古いバージョンを必要としています #4

Closed miracle777 closed 1 year ago

miracle777 commented 1 year ago

はじめまして。 Windows11 Python3.10 miniconda3

で、使いました。

現在下記のエラーが出て使えないです。

PS C:\Users\****\GPTSAN-main> py -3.10 run_generate.py --model GPTSAN-2.8B-spout_is_uniform/ --context "武田信玄は、戦国 時代ファンならぜひ押さえておきたい名将の一人。天下統一を目指し勢いに乗る織田信長からも、一目置かれていたと" Traceback (most recent call last): File "C:\Users\****\GPTSAN-main\run_generate.py", line 12, in <module> import modeling File "C:\Users\****\GPTSAN-main\modeling.py", line 5, in <module> from mesh_tensorflow.auto_mtf.api import layout as auto_layout File "C:\Users\****\AppData\Local\Programs\Python\Python310\lib\site-packages\mesh_tensorflow\auto_mtf\__init__.py", line 22, in <module> from mesh_tensorflow.auto_mtf import api File "C:\Users\****\AppData\Local\Programs\Python\Python310\lib\site-packages\mesh_tensorflow\auto_mtf\api.py", line 40, in <module> from mesh_tensorflow.auto_mtf import layout_optimizer File "C:\Users\****\AppData\Local\Programs\Python\Python310\lib\site-packages\mesh_tensorflow\auto_mtf\layout_optimizer.py", line 41, in <module> from ortools.sat.python import cp_model File "C:\Users\****\AppData\Local\Programs\Python\Python310\lib\site-packages\ortools\sat\python\cp_model.py", line 53, in <module> from ortools.sat import cp_model_pb File "C:\Users\****\AppData\Local\Programs\Python\Python310\lib\site-packages\ortools\sat\cp_model_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\****\AppData\Local\Programs\Python\Python310\lib\site-packages\google\protobuf\internal\__init__.py) PS C:\Users\****\GPTSAN-main> py -3.10 -m pip install --upgrade protobuf Requirement already satisfied: protobuf in c:\users\masar\appdata\local\programs\python\python310\lib\site-packages (3.19.6) Collecting protobuf Using cached protobuf-4.21.12-cp310-abi3-win_amd64.whl (527 kB) Installing collected packages: protobuf Attempting uninstall: protobuf Found existing installation: protobuf 3.19.6 Uninstalling protobuf-3.19.6: Successfully uninstalled protobuf-3.19.6 ERROR: pip's dependency resolver does not currently take into account all the packages that are installed. This behaviour is the source of the following dependency conflicts. tensorflow-intel 2.11.0 requires protobuf<3.20,>=3.9.2, but you have protobuf 4.21.12 which is incompatible. tensorboard 2.11.0 requires protobuf<4,>=3.9.2, but you have protobuf 4.21.12 which is incompatible. Successfully installed protobuf-4.21.12

エラーを機械翻訳しました。 protobufのバージョンが、3.9.2から3.20が、必要なようです。 でも、私は、新しいprotobuf 4.21.12 しかありません。

どこかで古いprotobuf を入手出来たらよいのですが。

このプログラムは、Python3.11では、動きませんでした。

File "E:\GPTSAN-main\run_generate.py", line 10, in <module> import tensorflow ModuleNotFoundError: No module named 'tensorflow'

Traceback (most recent call last): File "E:\GPTSAN-main\run_generate.py", line 12, in <module> import modeling File "E:\GPTSAN-main\modeling.py", line 4, in <module> import mesh_tensorflow as mtf ModuleNotFoundError: No module named 'mesh_tensorflow' というエラーが出てしまったからです。

良い解決策がありましたら、ぜひ、教えてください。 お願いします。

tanreinama commented 1 year ago

protobuf の問題では無く、ortoolsのバージョンが上がった際に競合が起こるようになったようです。最新のortoolsをインストールする際にprotobuf の最新版がインストールされ、それがtensorflowで必要なバージョンと競合します。

$ pip uninstall protobuf ortools
$ pip install protobuf==3.20
$ pip install ortools==9.1.9490

としてみてください。requirements.txtはアップデートしておきます。↑で駄目ならクリーンな環境にtensorflowのインストールからやり直してください。 ついでにDockerfileも作るので、出来たらDockerで実行すると再現性が良いと思います。

追記:ortoolsのインストールに --use-feature=2020-resolver は指定しないでください

miracle777 commented 1 year ago

ありがとうございます。 試しましたが、pip install ortools==9.1.9490 で値が合わない??みたいなエラーになりました。

そのためDockerの手順を試しました。 でも、そちらもパスのエラーになりました。

新しくして、書きたいと思います。 こちらは、終了で大丈夫です。 教えてくださって、ありがとうございます。