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

Error with set_backend() #21

Closed
ljchang opened this issue Nov 26, 2017 · 1 comment
Closed

Error with set_backend() #21

ljchang opened this issue Nov 26, 2017 · 1 comment

Comments

@ljchang
Copy link

ljchang commented Nov 26, 2017

Tensorly appears to be loading with 'mxnet' as a default backend, despite default_backend = 'numpy' in __init__.py.

I am unable to change the backend using tl.set_backend('numpy').

---------------------------------------------------------------------------
AttributeError                            Traceback (most recent call last)
<ipython-input-3-0d71df054526> in <module>()
     14             {k: v for (k, v) in backend.__dict__.items() if not k.startswith('_')
     15             })
---> 16 set_backend('numpy')

<ipython-input-3-0d71df054526> in set_backend(backend_name)
      6 
      7     # reloads tensorly.backend
----> 8     importlib.reload(backend)
      9 
     10     # reload from .backend import * (e.g. tensorly.tensor)

AttributeError: 'module' object has no attribute 'reload'

Am I missing something obvious? Also, there doesn't appear to be specific test for set_backend().

the 'backend' called by import.reload doesn't appear to be specified anywhere in the init.py file.

thanks for your help!

@JeanKossaifi
Copy link
Member

TensorLy is only developed for python 3, in which importlib has no attribute reload.
Updating to Python 3.5 or higher should fix your error.

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

2 participants