Ahmkel / Keras-Project-Template

A project template to simplify building and training deep learning models using Keras.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Auto added attribute in config instance when hasattr is called

tsikup opened this issue · comments

Issue

When hasattr() function is called on a DotMap instance (config in this case) regarding a non existing attribute, it is automatically created.

E.g. Let's say 'config' is a DotMap instance which does not have 'testAttr' as an attribute. It will be created after a hasattr() function call.

Solution

Convert DotMap instance to dict and then call hasattr, self.config.toDict().

or

replace hasattr() function with attr in self.config

I will open a pull request with my proposed solution tomorrow. 😃