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

Some of the problems encountered in the recurrence #4

Open
oula-le opened this issue Jul 30, 2021 · 1 comment
Open

Some of the problems encountered in the recurrence #4

oula-le opened this issue Jul 30, 2021 · 1 comment

Comments

@oula-le
Copy link

oula-le commented Jul 30, 2021

Hello,When I call the class 'AELearner' in the code in ae_runs. Py, I have the problem of 'the abstract class cannot be instantiated'.I have looked up a lot of information but failed to solve this problem, so I would like to ask if you have any good suggestions. I have not been in touch with this direction for a long time, and it is still difficult for me to reproduce the code, so I would like to ask you to send me a detailed introduction of the file order, or send me a code package that can run? It would be greatly appreciated if you could. If not, your reply will be greatly appreciated. My email address is hebeioulaoula@163.com.

@anderzzz
Copy link
Owner

Not sure what's causing that. You are running Python 3?

The abstract class is contained in _learner.py. Have you made any modifications to AELearner, like removing methods? The abstract base class is there to ensure instantiation is possible only if certain methods are included, see https://pythonprogramminglanguage.com/abstract-base-classes/

To run this, you should more or less write your own ae_runs so the image data is fed in correctly. If you are familiar with PyTorch and its typical training of models, you can rewrite AELearner. Most of AELearner and its parent class _Learner are taken from the functions described here: https://pytorch.org/tutorials/beginner/transfer_learning_tutorial.html

The only differences in what I do compared to what is done in the linked tutorial is: I don't simply load a model, the models.resnet18(pretrained=True) line in the tutorial. Rather I define a model in ae_deep.

Then once you have managed to get a good enough auto-encoder model, you train the model with LALearner by writing your own variant of la_runs.

Did you read the blog post I made? I go through a few explanations and steps in the code: https://towardsdatascience.com/image-clustering-implementation-with-pytorch-587af1d14123

Hope this helps. I should add that this is a tough problem. Getting the training to run well takes some careful adjustments.

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