gym_trading
gym_trading copied to clipboard
Hi, problem when running with with U.make_session(8)
config must be a tf.ConfigProto, but got <class 'int'>
I get this error and I wasn't able to resolve.
I solved this one ( I removed the 8) and left blank
but now I get this problem
module 'baselines.common.tf_util' has no attribute 'BatchInput'
What version of tensorflow do you use? Try with 1.5 version
Hi,
I solved this exact same issue by pasting the following code right before U.make_session()
`class TfInput(object): def init(self, name="(unnamed)"): """Generalized Tensorflow placeholder. The main differences are: - possibly uses multiple placeholders internally and returns multiple values - can apply light postprocessing to the value feed to placeholder. """ self.name = name def get(self): """Return the tf variable(s) representing the possibly postprocessed value of placeholder(s). """ raise NotImplementedError def make_feed_dict(data): """Given data input it to the placeholder(s).""" raise NotImplementedError
class PlaceholderTfInput(TfInput): def init(self, placeholder): """Wrapper for regular tensorflow placeholder.""" super().init(placeholder.name) self._placeholder = placeholder def get(self): return self._placeholder def make_feed_dict(self, data): return {self._placeholder: data}
class BatchInput(PlaceholderTfInput): def init(self, shape, dtype=tf.float32, name=None): """Creates a placeholder for a batch of tensors of a given shape and dtype Parameters ---------- shape: [int] shape of a single elemenet of the batch dtype: tf.dtype number representation used for tensor contents name: str name of the underlying placeholder """ super().init(tf.placeholder(dtype, [None] + list(shape), name=name))`
Hope it ehlps
i am also getting the same error
TypeError: config must be a tf.ConfigProto, but got <class 'int'>
please help
calling Batchinput from deepq.utils seems to be working
import baselines.deepq.utils as x
x.BatchInput(env.observation_space.shape, name=name)....