SAC actor crashes in training (train.py) : TanhNormalProjectionNetwork.call() got unexpected network_state
@Sidharth1743 is already working on this.
Since Oct 9, 2026.
Assessment
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Newbie friendliness
- 85/100
- Issue type
- Bug
- Clarity
- Clearly specified
- Activity status
- Active
- Tech stack
- python, tensorflow
- Domain
- machine-learning
Research direction
Fix lives in _TanhNormalProjectionNetworkWrapper.call() in smart_control/reinforcement_learning/agents/networks/sac_networks.py: it must accept network_state (and strip step_type) without forwarding it to TanhNormalProjectionNetwork.call(), exactly as the wrapper in smart_control/notebooks/SAC_Demo.ipynb and CQL_Demo.ipynb already does. Reproduce by running the train module with --agent-type sac after building the starter buffer; done means the SAC agent constructs and training starts.
Written by the indexing model from the issue text.
Description
summary
poetry run python -m smart_control.reinforcement_learning.scripts.train --agent-type sac dies while constructing the SAC agent. The environment and starter buffer load successfully. The failure is in _TanhNormalProjectionNetworkWrapper in smart_control/reinforcement_learning/agents/networks/sac_networks.py.
TF-Agents 0.18.0 NestMap always calls the child layer with network_state. The script wrapper accepts only inputs, **kwargs, so network_state is forwarded into TanhNormalProjectionNetwork.call(), which does not take that argument.
reference
The same wrapper in smart_control/notebooks/SAC_Demo.ipynb (and CQL_Demo.ipynb) already names the argument and does not forward it:
def call(self, inputs, network_state=(), **kwargs):
kwargs["outer_rank"] = self.predefined_outer_rank
if "step_type" in kwargs:
del kwargs["step_type"]
return super().call(inputs, **kwargs)
Environment
- Python 3.11
- Linux
tensorflow==2.15.1tf-agents==0.18.0(as pinned inpyproject.toml)- Keras 2.15.0
Steps to reproduce
-
Install with Poetry (
poetry install --with dev) and generate the starter buffer:poetry run python -m smart_control.reinforcement_learning.scripts.populate_starter_buffer \ --buffer-name starter -
Train SAC:
poetry run python -m smart_control.reinforcement_learning.scripts.train \ --starter-buffer-path smart_control/reinforcement_learning/data/starter_buffers/starter_seqlen2_exp500 \ --agent-type sac \ --experiment-name sac_run1
Actual behavior
SacAgent.__init__ calls actor_network.create_variables(), which calls the wrapper. Traceback ends with:
TypeError: Exception encountered when calling layer 'TanhNormalProjectionNetwork' (type _TanhNormalProjectionNetworkWrapper).
TanhNormalProjectionNetwork.call() got an unexpected keyword argument 'network_state'
Call arguments received by layer 'TanhNormalProjectionNetwork' (type _TanhNormalProjectionNetworkWrapper):
• inputs=tf.Tensor(shape=(1, 256), dtype=float32)
• kwargs={'network_state': (), 'step_type': '...', 'training': 'None'}
- Dominant language
- Python
- Stars
- 132
- Forks
- 64
- PR merge metrics
- No merged PRs in 30d
Getting set up
- Ships a Dockerfile or Docker Compose file
- Has a pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from google/sbsim
-
Fix Ubuntu Latest BuildPossibly taken @hamid-digitalmarketer claimed this 6 days ago. Opengood first issue help wanted
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
-
Baseline schedule policy emits actions in the wrong order for SB1Possibly taken @Sidharth1743 claimed this 25 days ago. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Convert `WeatherController.seconds_to_rads` to a Static MethodPossibly taken @Mustaphayinka claimed this 74 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 85/100
-
Baseline SchedulePolicy day/night switches early vs SB1 local comfort window (UTC hod + utcoffset)Possibly taken @burgulvedant claimed this 8 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 55/100
-
Failing Mac BuildPossibly taken @youneedgreg claimed this 25 days ago. Opengood first issue
Difficulty 3/5 1-2 days Newbie friendliness 54/100
Similar issues
-
HandyModRTransform.deriv3 is wrong for m > 2Possibly taken @SajalDevX claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
read_messages: the first read after subscribe/psubscribe returns no messages even when some are waitingPossibly taken @matheussilvano claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 80/100
The-Swarm-Corporation/swarms-framework-docs#399 ·
Maintainers usually reply within 2 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
bump patch
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
autowarefoundation/autoware_carla_scenario#1321 ·
Maintainers usually reply within 1 day