前提・実現したいこと
UnityのML-Agentsで機械学習を実行したいです。
https://qiita.com/2019Shun/items/d811bbd470fc9cddcc3d
上記の記事の通りにコマンドプロンプトで実行した際に以下のようなメッセージが表示されました。
発生している問題・エラーメッセージ
問題としては、10分程かかる機械学習がすぐに終わってしまい、結果が取得できませんでした。
2021-11-07 11:58:23.919168: E tensorflow/core/lib/monitoring/collection_registry.cc:77] Cannot register 2 metrics with the same name: /tensorflow/api/keras/optimizers 2021-11-07 11:58:23 INFO [trainer_controller.py:108] Saved Model Traceback (most recent call last): File "C:\Users\Handa\anaconda3\envs\ml-agents\Scripts\mlagents-learn-script.py", line 33, in <module> sys.exit(load_entry_point('mlagents', 'console_scripts', 'mlagents-learn')()) File "d:\unity_projects\ml-agents-release_3\ml-agents\mlagents\trainers\learn.py", line 322, in main run_cli(parse_command_line()) File "d:\unity_projects\ml-agents-release_3\ml-agents\mlagents\trainers\learn.py", line 318, in run_cli run_training(run_seed, options) File "d:\unity_projects\ml-agents-release_3\ml-agents\mlagents\trainers\learn.py", line 163, in run_training tc.start_learning(env_manager) File "d:\unity_projects\ml-agents-release_3\ml-agents-envs\mlagents_envs\timers.py", line 305, in wrapped return func(*args, **kwargs) File "d:\unity_projects\ml-agents-release_3\ml-agents\mlagents\trainers\trainer_controller.py", line 218, in start_learning self._create_trainers_and_managers(env_manager, new_behavior_ids) File "d:\unity_projects\ml-agents-release_3\ml-agents\mlagents\trainers\trainer_controller.py", line 204, in _create_trainers_and_managers self._create_trainer_and_manager(env_manager, behavior_id) File "d:\unity_projects\ml-agents-release_3\ml-agents\mlagents\trainers\trainer_controller.py", line 180, in _create_trainer_and_manager trainer.add_policy(parsed_behavior_id, policy) File "d:\unity_projects\ml-agents-release_3\ml-agents\mlagents\trainers\ppo\trainer.py", line 232, in add_policy self.optimizer = PPOOptimizer(self.policy, self.trainer_settings) File "d:\unity_projects\ml-agents-release_3\ml-agents\mlagents\trainers\ppo\optimizer.py", line 21, in __init__ policy.create_tf_graph() File "d:\unity_projects\ml-agents-release_3\ml-agents\mlagents\trainers\policy\nn_policy.py", line 91, in create_tf_graph self.vis_encode_type, File "d:\unity_projects\ml-agents-release_3\ml-agents\mlagents\trainers\policy\nn_policy.py", line 169, in _create_encoder vis_encode_type, File "d:\unity_projects\ml-agents-release_3\ml-agents\mlagents\trainers\models.py", line 581, in create_observation_streams reuse=False, File "d:\unity_projects\ml-agents-release_3\ml-agents\mlagents\trainers\models.py", line 267, in create_vector_observation_encoder hidden = tf.layers.dense( File "C:\Users\Handa\anaconda3\envs\ml-agents\lib\site-packages\tensorflow\python\util\lazy_loader.py", line 62, in __getattr__ module = self._load() File "C:\Users\Handa\anaconda3\envs\ml-agents\lib\site-packages\tensorflow\python\util\lazy_loader.py", line 45, in _load module = importlib.import_module(self.__name__) File "C:\Users\Handa\anaconda3\envs\ml-agents\lib\importlib\__init__.py", line 127, in import_module return _bootstrap._gcd_import(name[level:], package, level) File "<frozen importlib._bootstrap>", line 1006, in _gcd_import File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "<frozen importlib._bootstrap>", line 1006, in _gcd_import File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "<frozen importlib._bootstrap>", line 1006, in _gcd_import File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "<frozen importlib._bootstrap>", line 1006, in _gcd_import File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "<frozen importlib._bootstrap>", line 1006, in _gcd_import File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "<frozen importlib._bootstrap>", line 1006, in _gcd_import File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "<frozen importlib._bootstrap>", line 1006, in _gcd_import File "<frozen importlib._bootstrap>", line 983, in _find_and_load File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked File "<frozen importlib._bootstrap>", line 677, in _load_unlocked File "<frozen importlib._bootstrap_external>", line 728, in exec_module File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed File "C:\Users\Handa\anaconda3\envs\ml-agents\lib\site-packages\keras\__init__.py", line 25, in <module> from keras import models File "C:\Users\Handa\anaconda3\envs\ml-agents\lib\site-packages\keras\models.py", line 20, in <module> from keras import metrics as metrics_module File "C:\Users\Handa\anaconda3\envs\ml-agents\lib\site-packages\keras\metrics.py", line 26, in <module> from keras import activations File "C:\Users\Handa\anaconda3\envs\ml-agents\lib\site-packages\keras\activations.py", line 20, in <module> from keras.layers import advanced_activations File "C:\Users\Handa\anaconda3\envs\ml-agents\lib\site-packages\keras\layers\__init__.py", line 23, in <module> from keras.engine.input_layer import Input File "C:\Users\Handa\anaconda3\envs\ml-agents\lib\site-packages\keras\engine\input_layer.py", line 21, in <module> from keras.engine import base_layer File "C:\Users\Handa\anaconda3\envs\ml-agents\lib\site-packages\keras\engine\base_layer.py", line 43, in <module> from keras.mixed_precision import loss_scale_optimizer File "C:\Users\Handa\anaconda3\envs\ml-agents\lib\site-packages\keras\mixed_precision\loss_scale_optimizer.py", line 18, in <module> from keras import optimizers File "C:\Users\Handa\anaconda3\envs\ml-agents\lib\site-packages\keras\optimizers.py", line 26, in <module> from keras.optimizer_v2 import adadelta as adadelta_v2 File "C:\Users\Handa\anaconda3\envs\ml-agents\lib\site-packages\keras\optimizer_v2\adadelta.py", line 22, in <module> from keras.optimizer_v2 import optimizer_v2 File "C:\Users\Handa\anaconda3\envs\ml-agents\lib\site-packages\keras\optimizer_v2\optimizer_v2.py", line 37, in <module> "/tensorflow/api/keras/optimizers", "keras optimizer usage", "method") File "C:\Users\Handa\anaconda3\envs\ml-agents\lib\site-packages\tensorflow\python\eager\monitoring.py", line 361, in __init__ len(labels), name, description, *labels) File "C:\Users\Handa\anaconda3\envs\ml-agents\lib\site-packages\tensorflow\python\eager\monitoring.py", line 135, in __init__ self._metric = self._metric_methods[self._label_length].create(*args) tensorflow.python.framework.errors_impl.AlreadyExistsError: Another metric with the same name already exists.
該当のソースコード
mlagents-learn config/ppo/3DBall.yaml --run-id=first3DBallRun
試したこと
https://note.com/npaka/n/n167b2d03a347?magazine_key=m50f437a3f5e1#gqC2O
https://zenn.dev/kathmandu/articles/91e401bd070971
補足情報(FW/ツールのバージョンなど)
https://teratail.com/questions/265678
https://teratail.com/questions/223130?link=qa_related_pc
とほぼ同じエラーですがなかなか解決できません。。。
回答1件
あなたの回答
tips
プレビュー