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

AttributeError: 'NoneType' object has no attribute 'items' #6

Open
Nemesis9450 opened this issue Mar 19, 2024 · 1 comment
Open

AttributeError: 'NoneType' object has no attribute 'items' #6

Nemesis9450 opened this issue Mar 19, 2024 · 1 comment

Comments

@Nemesis9450
Copy link

Train the model

cnnhistory=model.fit(x_traincnn, y_train, batch_size=20, epochs=500, validation_data=(x_testcnn, y_test))

after running this i am getting issue as:

Epoch 1/500

AttributeError Traceback (most recent call last)
Cell In[50], line 2
1 # Train the model
----> 2 cnnhistory=model.fit(x_traincnn, y_train, batch_size=20, epochs=500, validation_data=(x_testcnn, y_test))

File C:\Users\samenanc\Lib\site-packages\keras\src\utils\traceback_utils.py:123, in filter_traceback..error_handler(*args, **kwargs)
120 filtered_tb = _process_traceback_frames(e.traceback)
121 # To get the full stack trace, call:
122 # keras.config.disable_traceback_filtering()
--> 123 raise e.with_traceback(filtered_tb) from None
124 finally:
125 del filtered_tb

File C:\Users\samenanc\Lib\site-packages\keras\src\trainers\trainer.py:854, in Trainer._pythonify_logs(self, logs)
852 def _pythonify_logs(self, logs):
853 result = {}
--> 854 for key, value in sorted(logs.items()):
855 if isinstance(value, dict):
856 result.update(self._pythonify_logs(value))

AttributeError: 'NoneType' object has no attribute 'items'

Please resolve issue as ASAP.

@achal-khanna
Copy link

I encountered the same issue when using the following optimizer configuration:

opt = keras.optimizers.RMSprop(lr=0.00005, rho=0.9, epsilon=None, decay=0.0)

The problem was caused by setting epsilon=None. The solution is to set a small value for epsilon (e.g., 1e-07). This resolved the error during training (AttributeError: 'NoneType' object has no attribute 'items').

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