iamalexkorotin/NeuralOptimalTransport

AttributeError: module 'ot' has no attribute 'weak_optimal_transport'

Closed this issue · 3 comments

zikai1 commented

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:
1702903046289

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

zikai1 commented

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 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.
1702961266781

Do you know why? Maybe I should ask for POT for some solution.

Best wishes,
Mingyang

zikai1 commented

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 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