gym_trading icon indicating copy to clipboard operation
gym_trading copied to clipboard

Hi, problem when running with with U.make_session(8)

Open Kalelv45 opened this issue 6 years ago • 5 comments

config must be a tf.ConfigProto, but got <class 'int'>

I get this error and I wasn't able to resolve.

Kalelv45 avatar Aug 29 '18 05:08 Kalelv45

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'

Kalelv45 avatar Aug 29 '18 06:08 Kalelv45

What version of tensorflow do you use? Try with 1.5 version

AdrianP- avatar Sep 01 '18 15:09 AdrianP-

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

abk11 avatar Nov 29 '18 17:11 abk11

i am also getting the same error

TypeError: config must be a tf.ConfigProto, but got <class 'int'>

please help

AchillesRevng avatar Jan 02 '19 10:01 AchillesRevng

calling Batchinput from deepq.utils seems to be working import baselines.deepq.utils as x x.BatchInput(env.observation_space.shape, name=name)....

ghost avatar Mar 13 '19 15:03 ghost