Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
Kalelv45 opened this issue Aug 29, 2018 · 5 comments
Open

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

Kalelv45 opened this issue Aug 29, 2018 · 5 comments

Comments

@Kalelv45
Copy link

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

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

@Kalelv45
Copy link
Author

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-
Copy link
Owner

AdrianP- commented Sep 1, 2018

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

@abk11
Copy link

abk11 commented Nov 29, 2018

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

@AchillesRevng
Copy link

i am also getting the same error

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

please help

@ghost
Copy link

ghost commented Mar 13, 2019

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants