question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

AttributeError: module 'lightly.models' has no attribute 'modules'

See original GitHub issue

I run into the following error when trying to use NNCLR’s NN memory bank.

Traceback (most recent call last):  
File "train_nnclr.py", line 295, in <module>     
    model = NNCLRModel(backbone = backbone)
File "train_nnclr.py", line 164, in __init__    
    nn_replacer = lightly.models.modules.nn_memory_bank.NNmemoryBankModule(size=2** 16)
AttributeError: module 'lightly.models' has no attribute 'modules'

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
philippmwirthcommented, Jul 27, 2021

Thanks, we will fix it ASAP. In the meantime you can use this workaround:

>>> from lightly.models import modules
>>> modules.nn_memory_bank.NNMemoryBankModule(size=2**16)
0reactions
philippmwirthcommented, Sep 15, 2021

The error most likely stems from a typo in the code: @etetteh used NNmemoryBankModule instead of the correct NNMemoryBankModule.

The following lines work:

import lightly
lightly.models.modules.nn_memory_bank.NNMemoryBankModule(size=2** 16)
Read more comments on GitHub >

github_iconTop Results From Across the Web

AttributeError: 'module' object has no attribute - Stack Overflow
Now I understand the main issue. This time my problem was importing Serializers ( django and restframework ) from different modules such as...
Read more >
lightly.models — lightly 1.2.38 documentation - lightly-docs
The lightly.models.modules package provides reusable modules. This package contains reusable modules such as the NNmemoryBankModule which can be combined with ...
Read more >
PYTHON : AttributeError: 'module' object has no attribute 'model'
PYTHON : AttributeError : ' module ' object has no attribute ' model ' [ Gift : Animated Search Engine : https://www.hows.tech/p/recommended.html ] ......
Read more >
Use Keras Deep Learning Models with Scikit-Learn in Python
In this post, you will discover how you can use deep learning models from Keras with the scikit-learn library in Python.
Read more >
PyXLL User Guide
modules = <add the name of your new module here>. [PYTHON] ... AttributeError: module ... ˓→has no attribute 'CLSIDToPackageMap'.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found