AdrianP- / gym_trading

Apache License 2.0
94 stars 25 forks source link

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

Open Kalelv45 opened 6 years ago

Kalelv45 commented 6 years ago

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

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

Kalelv45 commented 6 years ago

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'

AdrianP- commented 6 years ago

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

abk11 commented 5 years ago

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:

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

AchillesRevng commented 5 years ago

i am also getting the same error

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

please help

ghost commented 5 years ago

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