Skip to content
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

Fixing Threading error #207

Open
nithingovindarajan opened this issue Jul 11, 2022 · 3 comments
Open

Fixing Threading error #207

nithingovindarajan opened this issue Jul 11, 2022 · 3 comments

Comments

@nithingovindarajan
Copy link

I have tried running the following piece of code on my PC:

from typing import Sequence

import autograd.numpy as np
from numpy.typing import ArrayLike

import pymanopt
import pymanopt.manifolds
import pymanopt.optimizers


def test_lmlra_manopt():

    N = [5, 5, 4, 6]
    R = [2, 3, 2, 2]

    # Define manifold
    manifold = pymanopt.manifolds.Product(
        [pymanopt.manifolds.Stiefel(n, r) for n, r in zip(N, R)]
    )

    A = [np.random.normal(size=(n, r)) for n, r in zip(N, R)]

    @pymanopt.function.autograd(manifold)
    def cost(*point: Sequence[ArrayLike]) -> float:
        return sum([np.linalg.norm(x - a) ** 2 for x, a in zip(point, A)])

    @pymanopt.function.autograd(manifold)
    def euclidean_gradient(*point: Sequence[ArrayLike]) -> Sequence[ArrayLike]:
        return [2 * (x - a) for x, a in zip(point, A)]

    # solve problem
    problem = pymanopt.Problem(manifold, cost, euclidean_gradient=euclidean_gradient)
    optimizer = pymanopt.optimizers.SteepestDescent()
    result_manual = optimizer.run(problem)

    problem = pymanopt.Problem(manifold, cost)
    result_autograd = optimizer.run(problem)

    print(result_manual.point)
    print(result_autograd.point)

but Python completely crashes and I end up getting

Fatal Python error: Aborted

Thread 0x000060dc (most recent call first):
....

This error occurs at optimizer.run(). I think something is wrong with my environment (I am using conda). What specific information do I need to provide about my environment in order to get helped further?

@nkoep
Copy link
Member

nkoep commented Aug 6, 2022

Without any more information about which Python, numpy, scipy and autograd versions you are using there's not much we can do. The example runs fine for me on pymanopt 2.0.0 in a fresh virtualenv on Python 3.10.

@Diegoigerencia
Copy link

Hi, i have a problem i try to run "from recommenders.models.geoimc.geoimc_algorithm import IMCProblem" but i get the error:
ModuleNotFoundError: No module named 'pymanopt.solvers'.
how can i solve this?

@nkoep
Copy link
Member

nkoep commented Oct 11, 2022 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants