last day (15 days later) » 

9:14 PM
Hello Evan
This is the subpackage
ModuleNotFoundError: No module named 'commode_utils.callback'
So I installed pip install commode_utils
It insalled to to a folder that is not the default path, so I copied the downloaded package to my default Python folder and then did
pip show commode_utils
It gave me information about the package
 
Alright let me take a gander
Maybe the package is broken like you said
For commode_utils what version is installed?
 
on my side 0.4.1
 
@Avra Okay that's the latest
It insalled to to a folder that is not the default path, so I copied the downloaded package to my default Python folder and then did tbh this sounds a bit sus haha
 
I don't know, it seems the author made it like that
It's installed to a different folder with all packages needed for this module
 
Hey can you try doing from commode_utils import callbacks?
 
9:19 PM
So I copied all of them to my default site-packages
 
With the s
 
sure
one second please
 
because here the folder is `callbacks` with the s
https://github.com/SpirinEgor/commode-utils/tree/master/commode_utils
 
you are very smart
That correct the folder ends with s
Though other errors popped up due to naming...
 
@Avra Where did it get installed to? I don't think the author is doing anything special in his setup.py
 
9:23 PM
I will double check now
 
@Avra no worries I've made this mistake hundreds of times lol
 
weird no body told him about this error~
Maybe I should run python setup.py!!!
I did not run it though!
 
wait no
You shouldn't have to run it manually
pip install should be enough
My worry is that python is looking for the package in where pip installed it
But you copied it to your local site packages
 
yep
Because I run it separately, I first run pip install code2seq first without installing package to my folder.
It did not install commode-utils though
So, I also did pip install commode-utils
 
By my folder you mean your local site packages?
Btw are you on linux?
 
9:27 PM
the last command did not install it to defauult site-packages though
Yep on Ubuntu
 
@Avra what is the path of your default local site-packages
 
One second please:
/home/osboxes/miniconda3/envs/scikit-dev/lib/python3.6/site-packages/code2seq/utils/train.py"
 
Where did commode-utils get installed to then?
 
one second please
$ pip show commode-utils
Name: commode-utils
Version: 0.4.1
Summary: Set of useful functions and modules for Code Modeling
Home-page: https://github.com/SpirinEgor/commode-utils
Author: Egor Spirin
Author-email: spirin.egor@gmail.com
License: Apache 2.0
Location: /home/osboxes/miniconda3/envs/scikit-dev/lib/python3.6/site-packages
Requires: sacrebleu, torch, omegaconf, tqdm, torchmetrics, pytorch-lightning
Required-by: code2seq
 
Uh that looks correct
Okay nevermind, let's address the other errors then
Can you paste the error message for Though other errors popped up due to naming... here?
 
9:34 PM
one second pls
First, I did rename callback to callbacks from train.py that import this package as you told me.
Second, I then got another error: ImportError: cannot import name 'ModelCheckpointWithUpload'
 
Do you have an import statement with ModelCheckpointWithUpload?
 
It's not me,
The same file that raised callback error again import class:
So first one PrintEpochResultCallback got imported correctly
 
It imports ModelCheckpointWithUploadCallback not ModelCheckpointWithUpload
 
:(
YOU ARE RIGHT
I will change name too
Should I change ModelCheckpointWithUpload to ModelCheckpointWithUploadCallback
I changed train.py of code2seq to:
from os.path import join

import torch
from commode_utils.callbacks import PrintEpochResultCallback, ModelCheckpointWithUploadCallback
Is that okay please Evan?
 
Looks okay haha
In any case, if you encounter errors with regard to importing
It's good to look at the source code like what I did for you
Otherwise it is hard to debug
 
9:41 PM
It worked now!
I change name
Thank you for your time
I just got other minor errors
Appreciated it Evan!
Thank you for being generous to give me part of your invaluable time
 
No worries, I can't sleep so I'm just trying to pass the time lol
 
Have a nice day please and stay safe
Good night as well and have nice dreams :)))
 
All the best haha
 

last day (15 days later) »