baselines icon indicating copy to clipboard operation
baselines copied to clipboard

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

Open shadowyzy opened this issue 6 years ago • 3 comments

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.

shadowyzy avatar Jul 14 '19 03:07 shadowyzy

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.

thiagotandrade avatar Jul 15 '19 00:07 thiagotandrade

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

shadowyzy avatar Jul 15 '19 05:07 shadowyzy

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

chihyiwu0721 avatar Aug 18 '21 09:08 chihyiwu0721