TypeError: 'NoneType' object is not callable
See original GitHub issue🐛 Bug
(compiler_gym) zeyi@server121:~/scripts$ python main.py
Exception in thread Thread-1:
Traceback (most recent call last):
File ".../lib/python3.8/threading.py", line 932, in _bootstrap_inner
self.run()
File ".../lib/python3.8/threading.py", line 870, in run
self._target(*self._args, **self._kwargs)
File ".../lib/python3.8/site-packages/aim/ext/resource/tracker.py", line 102, in _stat_collector
self._track(stat)
File ".../lib/python3.8/site-packages/aim/ext/resource/tracker.py", line 78, in _track
self._track_func()(
TypeError: 'NoneType' object is not callable
To reproduce
Minimum example:
from aim import Run
def main():
run = Run()
for i in range(1000):
run.track(i, name="loss")
if __name__ == "__main__":
main()
This problem happens occasionally. In my case it happens one out of four times. However, if I change the script slightly, the problem above never appears.
from aim import Run
run = Run()
def main():
for i in range(1000):
run.track(i, name="loss")
if __name__ == "__main__":
main()
Notice that I moved the variable run
into global scope. I think the problem is due to some objects are de-referenced too quickly (e.g., the thread used to track? I’m not sure).
Expected behavior
The script should run without problem.
Environment
aim==3.4.1
aimrecords==0.0.7
aimrocks==0.0.10
Python 3.8.12
Linux server121 5.4.0-26-generic #30-Ubuntu SMP Mon Apr 20 16:58:30 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (6 by maintainers)
Top Results From Across the Web
Python NoneType object is not callable (beginner)
I faced the error "TypeError: 'NoneType' object is not callable " but for a different issue. With the above clues, i was able...
Read more >Python TypeError: 'nonetype' object is not callable Solution | CK
“TypeError: 'nonetype' object is not callable” occurs when you try to call a None value as if it were a function. ... To...
Read more >Can't figure out what the problem is - Codecademy
It is giving me a 'NoneType' object is not callable error and I can't seem to figure out why that is. It was...
Read more >TypeError: 'NoneType' object is not callable - TensorFlow Forum
Any idea why the following issue occured? This happen when I try to recompile the model using callback. It should work, right?
Read more >Typeerror: 'nonetype' object is not callable - CodeProject
The new error message is telling you that y_train does not contain any items.
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@alberttorosyan Yeah I can’t reproduce this problem with the new version of
aim
👍 nice fixNo I don’t call those functions explicitly. Could it be a concurrency problem? I’m having multiple
async
functions and each one of them has their ownaim.Run
object.