AttributeError: module 'ot' has no attribute 'weak_optimal_transport'
Closed this issue · 3 comments
Hi Alexander Korotin,
Thanks for your great work! I am quite interesting in your work that utilizes neural network to learn optimal maps and plans.
When I run the illustration part in demo NOT_toy_1D.ipynb
, the following error emerge:
It seems that the function weak_optimal_transport
in module OT
is missing. Could you please help solve the above error? Thank you very much.
Hi,
it seems like they changed the structure of the POT library which is used to get the discrete OT solution in the plotting code.
To fix the issue, in src/plotters.py
, you should change
ot.weak_optimal_transport
to
ot.weak.weak_optimal_transport
.
Hope this helps!
Best wishes,
Alex
Hi,
it seems like they changed the structure of the POT library which is used to get the discrete OT solution in the plotting code.
To fix the issue, in
src/plotters.py
, you should changeot.weak_optimal_transport
toot.weak.weak_optimal_transport
.Hope this helps!
Best wishes, Alex
Hi Alex,
Thanks! As suggested, I have changed ot.weak_optimal_transport
in src/plotters.py
to ot.weak.weak_optimal_transport
, as shown in the following. But the above issue still exists.
Do you know why? Maybe I should ask for POT for some solution.
Best wishes,
Mingyang
Hi,
it seems like they changed the structure of the POT library which is used to get the discrete OT solution in the plotting code.
To fix the issue, in
src/plotters.py
, you should changeot.weak_optimal_transport
toot.weak.weak_optimal_transport
.Hope this helps!
Best wishes, Alex
Hi Alex,
I have successfully solved the above issue. The problem is that the POT version POT==0.4.0
in requirement.txt
is a little bit old.
I have updated it to pip install POT==0.8.2
and the plotter.py
works.
Thank you again for you work!
Best wishes,
Mingyang