Skip to content

Commit d41a2a0

Browse files
author
Ervin T
committed
Fix SAC + LSTM Barracuda inference (#2698)
1 parent ada3bc5 commit d41a2a0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

ml-agents/mlagents/trainers/sac/models.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -556,10 +556,13 @@ def create_memory_ins(self, m_size):
556556
)
557557
# We assume m_size is divisible by 4
558558
# Create the non-Policy inputs
559+
# Use a default placeholder here so nothing has to be provided during
560+
# Barracuda inference. Note that the default value is just the tiled input
561+
# for the policy, which is thrown away.
559562
three_fourths_m_size = m_size * 3 // 4
560-
self.other_memory_in = tf.placeholder(
563+
self.other_memory_in = tf.placeholder_with_default(
564+
input=tf.tile(self.inference_memory_in, [1, 3]),
561565
shape=[None, three_fourths_m_size],
562-
dtype=tf.float32,
563566
name="other_recurrent_in",
564567
)
565568

0 commit comments

Comments
 (0)