-
Notifications
You must be signed in to change notification settings - Fork 115
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
not finding POT #57
Comments
@Estudiant-roqueta As you have conda, here is the list of commands that works for me: conda create -n tda-tutorial
conda activate tda-tutorial
conda install -c conda-forge python
which python # check it is somewhere in .../envs/tda-tutorial/...
pip install -r .binder/requirements.txt
pip install jupyter
jupyter notebook And from here, barycenter notebook works fine for me (with gudhi 3.5.0). It seems to you have a python kernel in your notebook that is not the one with which you installed pot or something like that. |
I have a similar error when calling the barry function b, log = bary(diags, I am running the notebook through google collab, i have installed the pot module and "import ot" executes without warning.. NameError Traceback (most recent call last) 1 frames NameError: name 'ot' is not defined |
I just tried on google colab, I added a code cell with |
thank you @mglisse, i had only to reinitialise my session for that to work ! |
I have POT, pymanopt autograd following POT instructions in https://pythonot.github.io/index.html. I made git clone of this github to try the tutorials and so. everything installed, most of them work. But when I try to run Tuto-GUDHI-Barycenters-of-persistence.diagrams.ipyb when it calls bary this happens:
b, log = bary(diags,
init=0,
verbose=True) # we initialize our estimation on the first diagram (the red one.)
NameError Traceback (most recent call last)
~\AppData\Local\Temp/ipykernel_10868/2194333359.py in
----> 1 b, log = bary(diags,
2 init=0,
3 verbose=True) # we initialize our estimation on the first diagram (the red one.)
~\anaconda3\lib\site-packages\gudhi\wasserstein\barycenter.py in lagrangian_barycenter(pdiagset, init, verbose)
92 # the points of Y.
93 # If points disappear, there thrown
---> 94 # on [0,0] by default.
95 new_created_points = [] # will store potential new points.
96
~\anaconda3\lib\site-packages\gudhi\wasserstein\wasserstein.py in wasserstein_distance(X, Y, matching, order, internal_p, enable_autodiff, keep_essential_parts)
319 if matching:
320 assert not enable_autodiff, "matching and enable_autodiff are currently incompatible"
--> 321 P = ot.emd(a=a,b=b,M=M, numItermax=2000000)
322 ot_cost = np.sum(np.multiply(P,M))
323 P[-1, -1] = 0 # Remove matching corresponding to the diagonal
NameError: name 'ot' is not defined
I revised the files and they import OT correctly. I even tried to put "import ot" in the exact subprocess but even then it does not recognize it.
The text was updated successfully, but these errors were encountered: