openai / baselines

OpenAI Baselines: high-quality implementations of reinforcement learning algorithms
MIT License
15.83k stars 4.88k forks source link

module 'baselines.deepq.models' has no attribute 'cnn_to_mlp' #961

Open shadowyzy opened 5 years ago

shadowyzy commented 5 years ago

Hi, when I run the code below, I got this error.

Traceback (most recent call last):
  File "/Users/yzy/Desktop/minerl/minerl/tests/excluded/navigate_dqn_test.py", line 21, in <module>
    model = deepq.models.cnn_to_mlp(
AttributeError: module 'baselines.deepq.models' has no attribute 'cnn_to_mlp'

The code is:

import gym
import itertools
import minerl
import numpy as np
import tensorflow as tf
import tensorflow.contrib.layers as layers

import baselines.common.tf_util as U

from baselines import logger
from baselines import deepq
from baselines.deepq.replay_buffer import ReplayBuffer
from baselines.common.schedules import LinearSchedule

import logging

import coloredlogs
coloredlogs.install(logging.INFO)

model = deepq.models.cnn_to_mlp(
    convs=[(32, 8, 4), (64, 4, 2), (64, 3, 1)],
    hiddens=[256],
    dueling=True
)
……

Thanks very much if someone can help.

thiagotandrade commented 5 years ago

Apparently they've removed all models from baselines/deepq/models.py. You can find the commit here: #946

I can't seem to find where they are now.

shadowyzy commented 5 years ago

Thanks for your replay ! I fixed it by using git to return to the previous version .

chihyiwu0721 commented 3 years ago

Can you tell me how did you do that with git?