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
Import Error: KeyError: 'asscalar'
#363
Comments
Thanks for the bug report. This is not a known issue. Is this using the latest scico release from pypi, or the development version from github? What are the version numbers of jaxlib and jax that you have installed? |
Thanks for fast response!
|
Thanks. Those are very recent versions of jaxlib/jax that are not yet included in the supported range specified in the scico |
I'm observing the same issue when downgrading to |
I'm unable to replicate the problem under OSX. Could you please run the following and let me know the output? import jax.numpy as jnp
print(jnp.asscalar)
print(jnp.__dict__['asscalar']) |
Thanks @bwohlberg for helping out. I get the following error: >>> import jax.numpy as jnp
>>> print(jnp.asscalar)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'jax.numpy' has no attribute 'asscalar'
>>> print(jnp.__dict__['asscalar'])
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
KeyError: 'asscalar' This indeed is weird. I'll quickly try that on colab, but this should be fine I gues.. |
On further investigation, I see that It would be useful to confirm that |
Hey @bwohlberg, with outcomment this line, the problem disappears. As for the notes, I installed jax using this command on a MacBook m1:
After that I'm trying to run this notebook: https://scico.readthedocs.io/en/latest/examples/deconv_microscopy_tv_admm.html which gave me an error with a missing Later I'm running into a connection timeout error, but this is hopefully due to my non stable internet connection right now. I'll try it once I'm back home again. Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/
Collecting git+https://github.com/lanl/scico
Cloning https://github.com/lanl/scico to /tmp/pip-req-build-sxfyw5bu
Running command git clone -q https://github.com/lanl/scico /tmp/pip-req-build-sxfyw5bu
Running command git submodule update --init --recursive -q
From https://github.com/lanl/scico-data
* branch c3b7db1f69967833d178e029713d5200f9fc6304 -> FETCH_HEAD
Installing build dependencies ... done
Getting requirements to build wheel ... done
Preparing wheel metadata ... done
Requirement already satisfied: jax<=0.3.23,>=0.3.0 in /usr/local/lib/python3.7/dist-packages (from scico==0.0.4.dev0+cf5ad2f) (0.3.23)
Requirement already satisfied: scipy>=1.6.0 in /usr/local/lib/python3.7/dist-packages (from scico==0.0.4.dev0+cf5ad2f) (1.7.3)
Requirement already satisfied: jaxlib<=0.3.22,>=0.3.0 in /usr/local/lib/python3.7/dist-packages (from scico==0.0.4.dev0+cf5ad2f) (0.3.22+cuda11.cudnn805)
Collecting flax>=0.4.0
Downloading flax-0.6.1-py3-none-any.whl (185 kB)
|████████████████████████████████| 185 kB 3.4 MB/s
Requirement already satisfied: matplotlib in /usr/local/lib/python3.7/dist-packages (from scico==0.0.4.dev0+cf5ad2f) (3.2.2)
Collecting pyabel>=0.8.5
Downloading PyAbel-0.8.5.tar.gz (147 kB)
|████████████████████████████████| 147 kB 45.0 MB/s
Requirement already satisfied: tifffile in /usr/local/lib/python3.7/dist-packages (from scico==0.0.4.dev0+cf5ad2f) (2021.11.2)
Collecting bm3d>=3.0.9
Downloading bm3d-3.0.9-py3-none-any.whl (8.4 MB)
|████████████████████████████████| 8.4 MB 58.7 MB/s
Collecting imageio>=2.17
Downloading imageio-2.22.4-py3-none-any.whl (3.4 MB)
|████████████████████████████████| 3.4 MB 43.6 MB/s
Requirement already satisfied: numpy>=1.20.0 in /usr/local/lib/python3.7/dist-packages (from scico==0.0.4.dev0+cf5ad2f) (1.21.6)
Collecting svmbir>=0.3.0
Downloading svmbir-0.3.0.tar.gz (65 kB)
|████████████████████████████████| 65 kB 4.3 MB/s
Installing build dependencies ... error
WARNING: Discarding https://files.pythonhosted.org/packages/0c/16/909f298bd2ab94ff8d60522107f8c5d2ae77a5870932d6d2d131c3ae31a1/svmbir-0.3.0.tar.gz#sha256=840bbd99de28483e4d7b3642b6fc5552fd0e3954a6db5288b82840a75105d8ce (from https://pypi.org/simple/svmbir/). Command errored out with exit status 1: /usr/bin/python3 /tmp/pip-standalone-pip-pbtta9bj/__env_pip__.zip/pip install --ignore-installed --no-user --prefix /tmp/pip-build-env-psqxo_y8/overlay --no-warn-script-location -v --no-binary :none: --only-binary :none: -i https://pypi.org/simple --extra-index-url https://us-python.pkg.dev/colab-wheels/public/simple/ -- setuptools wheel 'numpy==1.22.*' Cython Check the logs for full command output.
ERROR: Could not find a version that satisfies the requirement svmbir>=0.3.0 (from scico) (from versions: 0.2.0, 0.2.1, 0.2.2, 0.2.3, 0.2.4, 0.2.5, 0.2.6, 0.2.7, 0.2.8, 0.2.9, 0.2.10, 0.3.0)
ERROR: No matching distribution found for svmbir>=0.3.0
---------------------------------------------------------------------------
ModuleNotFoundError Traceback (most recent call last)
[<ipython-input-1-4c8b686bae40>](https://localhost:8080/#) in <module>
6 get_ipython().system('pip install git+https://github.com/lanl/scico')
7
----> 8 import scico.numpy as snp
9 from scico import functional, linop, loss, plot, util
10 from scico.examples import downsample_volume, epfl_deconv_data, tile_volume_slices
ModuleNotFoundError: No module named 'scico'
---------------------------------------------------------------------------
NOTE: If your import is failing due to a missing package, you can
manually install dependencies using either !pip or !apt.
To view examples of installing some common dependencies, click the
"Open Examples" button below.
--------------------------------------------------------------------------- I don't think this is a related issue, is it? |
Thanks for reporting the notebook problem on Colab. I have opened #364 as a note that this should be resolved. Note that the |
Ok. Seems to be working on my machine. But I must admit, I'm not yet familiar with the way arm64 and x86_64 packages are to be installed on this new machine. Most likely the error is due to some conflicts with these versions. Thanks for helping! |
Agreed, it's probably some difference between the arm64 and x86_64 packages. We'll close this issue when #365 is merged. Please don't hesitate to open another issue if you experience further problems. |
* Remove deprecated asscalar (see #363) * Handle names not in target_dict * Bump jaxlib/jax versions * Resolve mypy errors and warnings * Attempt to debug test failures * Clean up * Address test warnings
Hello @bwohlberg, I encounter the same package_info:
All installed via p.s. |
Thanks for reporting this issue. Could you please try installing the current development version from github and let us know if the problem persists? We have made some changes to resolve this issue, but the updated version has not yet been released. |
I installed |
Great, thank you for confirming that it's resolved by the unreleased changed. |
Hey, first of all, great project! I'm really looking forward to work with this software! However, I'm running into some problems when installing and starting Scico. I'm running it on a Macbook M1, where I installed jax/jaxlib using this command:
I had to make sure that scico leaves this installation untouched - I guess it tries installing its pip equivalent? Didn't work out nicely..
After trying to import the scico package I get this error:
I get this in the latest pipy and github version. I haven't looked too deep into the sources to understand therror- but is it known already?
Thanks! Help very much appreciated!
The text was updated successfully, but these errors were encountered: