You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 6, 2023. It is now read-only.
I am developing AI-Economist and I am trying to run my own modified version of AI-Economist with your provided custom neural network models: KerasConvLSTM and RandomAction.
Here is my system properties:
Model Name: MacBook Pro
Model Identifier: MacBookPro17,1
Chip: Apple M1
Total Number of Cores: 8 (4 performance and 4 efficiency)
Memory: 16 GB
Here is the list of modules in my modified ai-economist environment:
As it is clear from the above list, there are some extra modules beside the required modules of the original AI-Economist and also some modules have different versions than what are mentioned in the original AI-Economist. For example, the ray version here is 2.0.0. I think with this version of ray, the parent class of any tensorflow recurrent custom model should be set RecurrentNetwork instead of RecurrentTFModelV2, so I made modifications in tf_models as required.
Then, I ran the following commands similar to what are brought in your provided notebook: multi_agent_training_with_rllib
from rllib.env_wrapper import RLlibEnvWrapper
env_obj = RLlibEnvWrapper({"env_config_dict": env_config_dict}, verbose=True)
import ray
from ray.rllib.agents.ppo import PPOTrainer
from ray.rllib.models.catalog import ModelCatalog
from rllib.tf_models import KerasConvLSTM, RandomAction
RayActorError: The actor died because of an error raised in its creation task, ray::RolloutWorker.init() (pid=1353, ip=127.0.0.1, repr=<ray.rllib.evaluation.rollout_worker.RolloutWorker object at 0x16a373790>)
File "/Users/asataryd/miniforge3/envs/modified-ai-economist/lib/python3.10/site-packages/ray/rllib/evaluation/rollout_worker.py", line 613, in init
self._build_policy_map(
File "/Users/asataryd/miniforge3/envs/modified-ai-economist/lib/python3.10/site-packages/ray/rllib/evaluation/rollout_worker.py", line 1784, in _build_policy_map
self.policy_map.create_policy(
File "/Users/asataryd/miniforge3/envs/modified-ai-economist/lib/python3.10/site-packages/ray/rllib/policy/policy_map.py", line 123, in create_policy
self[policy_id] = create_policy_for_framework(
File "/Users/asataryd/miniforge3/envs/modified-ai-economist/lib/python3.10/site-packages/ray/rllib/utils/policy.py", line 71, in create_policy_for_framework
return policy_class(
File "/Users/asataryd/miniforge3/envs/modified-ai-economist/lib/python3.10/site-packages/ray/rllib/algorithms/ppo/ppo_tf_policy.py", line 83, in init
base.init(
File "/Users/asataryd/miniforge3/envs/modified-ai-economist/lib/python3.10/site-packages/ray/rllib/policy/dynamic_tf_policy_v2.py", line 81, in init
self.model = self.make_model()
File "/Users/asataryd/miniforge3/envs/modified-ai-economist/lib/python3.10/site-packages/ray/rllib/policy/dynamic_tf_policy_v2.py", line 221, in make_model
return ModelCatalog.get_model_v2(
File "/Users/asataryd/miniforge3/envs/modified-ai-economist/lib/python3.10/site-packages/ray/rllib/models/catalog.py", line 587, in get_model_v2
raise ValueError(
ValueError: It looks like you are still using <rllib.tf_models.KerasConvLSTM object at 0x16a6f2ec0>.register_variables() to register your model's weights. This is no longer required, but if you are still calling this method at least once, you must make sure to register all created variables properly. The missing variables are {<Reference wrapping <tf.Variable 'a_wk4/conv2D_2_pol/kernel:0' shape=(3, 3, 16, 32) dtype=float32>>, <Reference wrapping <tf.Variable 'a_wk4/value/bias:0' shape=(1,) dtype=float32>>, <Reference wrapping <tf.Variable 'a_wk4/conv2D_1_pol/bias:0' shape=(16,) dtype=float32>>, <Reference wrapping <tf.Variable 'a_wk4/layer_norm_pol/beta:0' shape=(128,) dtype=float32>>, <Reference wrapping <tf.Variable 'a_wk4/conv2D_1_pol/kernel:0' shape=(3, 3, 26, 16) dtype=float32>>, <Reference wrapping <tf.Variable 'a_wk4/lstm_pol/lstm_cell/bias:0' shape=(512,) dtype=float32>>, <Reference wrapping <tf.Variable 'a_wk4/lstm_val/lstm_cell_1/bias:0' shape=(512,) dtype=float32>>, <Reference wrapping <tf.Variable 'a_wk4/value/kernel:0' shape=(128, 1) dtype=float32>>, <Reference wrapping <tf.Variable 'a_wk4/dense2_pol/bias:0' shape=(128,) dtype=float32>>, <Reference wrapping <tf.Variable 'a_wk4/logits/bias:0' shape=(80,) dtype=float32>>, <Reference wrapping <tf.Variable 'a_wk4/conv2D_2_val/kernel:0' shape=(3, 3, 16, 32) dtype=float32>>, <Reference wrapping <tf.Variable 'a_wk4/layer_norm_val/beta:0' shape=(128,) dtype=float32>>, <Reference wrapping <tf.Variable 'a_wk4/lstm_pol/lstm_cell/recurrent_kernel:0' shape=(128, 512) dtype=float32>>, <Reference wrapping <tf.Variable 'a_wk4/logits/kernel:0' shape=(128, 80) dtype=float32>>, <Reference wrapping <tf.Variable 'a_wk4/dense1_val/kernel:0' shape=(234, 128) dtype=float32>>, <Reference wrapping <tf.Variable 'a_wk4/dense1_val/bias:0' shape=(128,) dtype=float32>>, <Reference wrapping <tf.Variable 'a_wk4/embedding_pol/embeddings:0' shape=(100, 4) dtype=float32>>, <Reference wrapping <tf.Variable 'a_wk4/layer_norm_pol/gamma:0' shape=(128,) dtype=float32>>, <Reference wrapping <tf.Variable 'a_wk4/conv2D_2_val/bias:0' shape=(32,) dtype=float32>>, <Reference wrapping <tf.Variable 'a_wk4/conv2D_2_pol/bias:0' shape=(32,) dtype=float32>>, <Reference wrapping <tf.Variable 'a_wk4/conv2D_1_val/bias:0' shape=(16,) dtype=float32>>, <Reference wrapping <tf.Variable 'a_wk4/lstm_val/lstm_cell_1/recurrent_kernel:0' shape=(128, 512) dtype=float32>>, <Reference wrapping <tf.Variable 'a_wk4/dense2_pol/kernel:0' shape=(128, 128) dtype=float32>>, <Reference wrapping <tf.Variable 'a_wk4/lstm_pol/lstm_cell/kernel:0' shape=(128, 512) dtype=float32>>, <Reference wrapping <tf.Variable 'a_wk4/conv2D_1_val/kernel:0' shape=(3, 3, 26, 16) dtype=float32>>, <Reference wrapping <tf.Variable 'a_wk4/dense2_val/kernel:0' shape=(128, 128) dtype=float32>>, <Reference wrapping <tf.Variable 'a_wk4/dense2_val/bias:0' shape=(128,) dtype=float32>>, <Reference wrapping <tf.Variable 'a_wk4/dense1_pol/kernel:0' shape=(234, 128) dtype=float32>>, <Reference wrapping <tf.Variable 'a_wk4/dense1_pol/bias:0' shape=(128,) dtype=float32>>, <Reference wrapping <tf.Variable 'a_wk4/embedding_val/embeddings:0' shape=(100, 4) dtype=float32>>, <Reference wrapping <tf.Variable 'a_wk4/layer_norm_val/gamma:0' shape=(128,) dtype=float32>>, <Reference wrapping <tf.Variable 'a_wk4/lstm_val/lstm_cell_1/kernel:0' shape=(128, 512) dtype=float32>>}, and you only registered {<tf.Variable 'a_wk4/conv2D_2_pol/kernel:0' shape=(3, 3, 16, 32) dtype=float32>, <tf.Variable 'a_wk4/conv2D_1_pol/bias:0' shape=(16,) dtype=float32>, <tf.Variable 'a_wk4/value/bias:0' shape=(1,) dtype=float32>, <tf.Variable 'a_wk4/conv2D_1_pol/kernel:0' shape=(3, 3, 26, 16) dtype=float32>, <tf.Variable 'a_wk4/layer_norm_pol/beta:0' shape=(128,) dtype=float32>, <tf.Variable 'a_wk4/lstm_pol/lstm_cell/bias:0' shape=(512,) dtype=float32>, <tf.Variable 'a_wk4/lstm_val/lstm_cell_1/bias:0' shape=(512,) dtype=float32>, <tf.Variable 'a_wk4/value/kernel:0' shape=(128, 1) dtype=float32>, <tf.Variable 'a_wk4/dense2_pol/bias:0' shape=(128,) dtype=float32>, <tf.Variable 'a_wk4/conv2D_2_val/kernel:0' shape=(3, 3, 16, 32) dtype=float32>, <tf.Variable 'a_wk4/logits/bias:0' shape=(80,) dtype=float32>, <tf.Variable 'a_wk4/layer_norm_val/beta:0' shape=(128,) dtype=float32>, <tf.Variable 'a_wk4/lstm_pol/lstm_cell/recurrent_kernel:0' shape=(128, 512) dtype=float32>, <tf.Variable 'a_wk4/logits/kernel:0' shape=(128, 80) dtype=float32>, <tf.Variable 'a_wk4/dense1_val/kernel:0' shape=(234, 128) dtype=float32>, <tf.Variable 'a_wk4/dense1_val/bias:0' shape=(128,) dtype=float32>, <tf.Variable 'a_wk4/embedding_pol/embeddings:0' shape=(100, 4) dtype=float32>, <tf.Variable 'a_wk4/layer_norm_pol/gamma:0' shape=(128,) dtype=float32>, <tf.Variable 'a_wk4/conv2D_2_val/bias:0' shape=(32,) dtype=float32>, <tf.Variable 'a_wk4/conv2D_2_pol/bias:0' shape=(32,) dtype=float32>, <tf.Variable 'a_wk4/conv2D_1_val/bias:0' shape=(16,) dtype=float32>, <tf.Variable 'a_wk4/lstm_val/lstm_cell_1/recurrent_kernel:0' shape=(128, 512) dtype=float32>, <tf.Variable 'a_wk4/dense2_pol/kernel:0' shape=(128, 128) dtype=float32>, <tf.Variable 'a_wk4/lstm_pol/lstm_cell/kernel:0' shape=(128, 512) dtype=float32>, <tf.Variable 'a_wk4/conv2D_1_val/kernel:0' shape=(3, 3, 26, 16) dtype=float32>, <tf.Variable 'a_wk4/dense2_val/kernel:0' shape=(128, 128) dtype=float32>, <tf.Variable 'a_wk4/dense2_val/bias:0' shape=(128,) dtype=float32>, <tf.Variable 'a_wk4/dense1_pol/kernel:0' shape=(234, 128) dtype=float32>, <tf.Variable 'a_wk4/dense1_pol/bias:0' shape=(128,) dtype=float32>, <tf.Variable 'a_wk4/embedding_val/embeddings:0' shape=(100, 4) dtype=float32>, <tf.Variable 'a_wk4/layer_norm_val/gamma:0' shape=(128,) dtype=float32>, <tf.Variable 'a_wk4/lstm_val/lstm_cell_1/kernel:0' shape=(128, 512) dtype=float32>}. Did you forget to call register_variables() on some of the variables in question?
This happen even if I use RandomAction network. Also, in your provided notebook, you have not used these custom modelsI. Moreover, I think this is most probably not related to the changes that I made in the AI-Economist but it might be related to the compatibility issues of different versions of the modules that I have in my environment. I greatly appreciate any comments.
By the way, please let me know if you need further information. If it is required I would be happy to share the GitHub repository of my own version of AI-Economist with you. Many thanks in advance!
The text was updated successfully, but these errors were encountered:
Hi there, as you noticed there are many compatibility issues in AI-Economist...
To fix your problem you just have to comment register_variables(). Note that many other issues are ahead of this one. I think there are compatibility issues between rllib, tensorflow + non full retro-compatibility when you start upgrading stuff.
Hello,
I am developing AI-Economist and I am trying to run my own modified version of AI-Economist with your provided custom neural network models: KerasConvLSTM and RandomAction.
Here is my system properties:
Here is the list of modules in my modified ai-economist environment:
Name Version Build Channel
As it is clear from the above list, there are some extra modules beside the required modules of the original AI-Economist and also some modules have different versions than what are mentioned in the original AI-Economist. For example, the ray version here is 2.0.0. I think with this version of ray, the parent class of any tensorflow recurrent custom model should be set RecurrentNetwork instead of RecurrentTFModelV2, so I made modifications in tf_models as required.
Then, I ran the following commands similar to what are brought in your provided notebook: multi_agent_training_with_rllib
However, the following error is generated:
This happen even if I use RandomAction network. Also, in your provided notebook, you have not used these custom modelsI. Moreover, I think this is most probably not related to the changes that I made in the AI-Economist but it might be related to the compatibility issues of different versions of the modules that I have in my environment. I greatly appreciate any comments.
By the way, please let me know if you need further information. If it is required I would be happy to share the GitHub repository of my own version of AI-Economist with you. Many thanks in advance!
The text was updated successfully, but these errors were encountered: