-
Notifications
You must be signed in to change notification settings - Fork 323
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
How to use SSLOnlineEvaluator callback #309
Comments
I believe this PR #277 fixed this |
Cool. I see that an 'output' arg was added. I will install the latest version from GitHub. Just an offset question: If I do not want to install the blots package again by |
I never tried that but you should be able to make it work. You probably have to add it to the python path or similar to have the imports working. |
Cool. There is a new bug, when I upgrade to the master version. The network maltiplication has a dimension not match as
The output information
This bug only happens if I add callback. I works fine for a few time(not sure if it is step, iterations ...), but then it gives |
The above mentioned issue is with my customed datamodule. Here is a different issue with official CIFAR10. The issue seems to relate with CUDA, not sure if the problem is on my side. Just to make it clear, all codes run well without callbacks passed in.
|
@FrankXinqi what is the number of classes being passed to SSLOnlineEvaluator. What looks to me is the case when num_classes being passed is different than the class labels found in target tensor. |
@FrankXinqi for the first issue, I am merging a fix which should solve this issue. The output of resnet now is a flattened 2048 dimensional feature vector which is taken by the online evaluation callback. |
My cutomized dataset has 7 output classes. For CIFAR10, it put is as 10. However, neither my own dataset or pl CIFAR10 do not work. |
Many thanks. For the first issue, do you mean this issue "RuntimeError: mat1 dim 1 must match mat2 dim 0"? If so, it may take some time to merge your PR to the master branch. Would you mind pointing out the solution, so I can fix it locally? Thx. |
@FrankXinqi changed quite a few things around, like a whole revamp of simclr, difficult to point to a single change. |
Thanks. Seems like there was a merge 14 days ago, but not recently. Wanna to know if I reinstall the lastest one from Github, will the problem be fixed? |
https://github.com/PyTorchLightning/pytorch-lightning-bolts/tree/fix/simclr This is the branch that will be merged. The PR will close this issue because we have removed all the complexity of SSLOnlineEvaluator callback. Feel free to open new issues based on the new code base if something doesn't work still. |
Thanks. I will try it later and response to this issue still, if there are other bugs met. |
❓ Questions and Help
Before asking:
Lightning Forum Posted Question: https://forums.pytorchlightning.ai/t/how-to-use-sslonlineevaluator/309
What is your question?
I study the code provided here SSL SimCLR on colab, and implemented a similar code.
I have modified the datamodule to load mine, and I can run the code. However, if I use SSLOnlineEvaluator. I cannot make it work. If I specify the callbacks for model, the error shows:
TypeError: on_train_batch_end() takes 6 positional arguments but 7 were given
Code
I have the following code:
Full Output information:
What have you tried?
Try to put OnlineEvaluator as the only callback, but it does not work as well.
What's your environment?
python 3.8.6
pytorch 1.6.0
pytorch-lightning 1.0.2 py_0 conda-forge
pytorch-lightning-bolts 0.2.5 pypi_0 pypi
The text was updated successfully, but these errors were encountered: