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

'BaseRLModel' is not callable? #143

Open
reasondk opened this issue Sep 23, 2020 · 1 comment
Open

'BaseRLModel' is not callable? #143

reasondk opened this issue Sep 23, 2020 · 1 comment

Comments

@reasondk
Copy link

Hi, guys, 'RLTrade.py' this model display "'BaseRLModel' is not callable?" , why?

def initialize_optuna(self):
    try:
        train_env = DummyVecEnv([lambda: TradingEnv(self.data_provider)])
        model = self.Model(self.Policy, train_env, nminibatches=1)                   ###  'BaseRLModel' is not callable???
        strategy = self.Reward_Strategy()                                                            ###  'BaseRewardStrategy' is not callable???
        self.study_name = f'{model.__class__.__name__}__{model.act_model.__class__.__name__}__{strategy.__class__.__name__}'
    except:
        self.study_name = f'UnknownModel__UnknownPolicy__UnknownStrategy'
@MichaelQuaMan
Copy link

MichaelQuaMan commented Feb 2, 2022

@reasondk Are you seeing that message as part of PyCharms inspections; b/c that's where I'm seeing it.

It's not "Callable" because the argument BaseRLModel is passed in as a "Class" and not an instance of a class, and the class doesn't implement an __call__ method. I've tried to implement a __class__ method, but it wasn't worth the effort.

I haven't had any problems because of this "warning".

I've concluded it's just a false positive, intended for a different context.

The code works fine as written.

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

2 participants