Hello Vanessa and thank you for your interest in POT. emd on very large matrices is a very interesting problem. To be frank we did not try it over 1000x1000 The emd solver is based on C code and to my shame there are some parameters that are still hard coded here https://github.com/rflamary/POT/blob/master/ot/lp/EMD_wrapper.cpp such that the max number of iteration line 22 there are probably other parameters in the code that would help the problem work in very large matrices. You can have a look and change them before building POT again (be carefull to uninstall is with pip before). Feel free to open an Issue on github with the code that reproduce the bug, since it's summer I don't know if anybody will be available on short notice. I know Antoine rolet has been working on an improvement to the emd wrapper here https://github.com/arolet/POT Rémi