Skip to content

Update numpy #18

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

Open
nducros opened this issue Oct 18, 2024 · 4 comments
Open

Update numpy #18

nducros opened this issue Oct 18, 2024 · 4 comments
Assignees
Labels
bug Something isn't working

Comments

@nducros
Copy link
Member

nducros commented Oct 18, 2024

%runcell -n 'Neural Network setup (executed it just one time)' D:/hspc/scripts/main_seq_2arms.py
Device: cpu
Traceback (most recent call last):

File ~\Anaconda3\envs\without_dll\Lib\site-packages\spyder_kernels\customize\utils.py:209 in exec_encapsulate_locals
exec_fun(compile(code_ast, filename, "exec"), globals)

File d:\hspc\scripts\main_seq_2arms.py:166
model, device = setup_reconstruction(cov_path, model_folder, network_param)

File c:\openspyrit\spas\spas\reconstruction_nn.py:102 in setup_reconstruction
Forward = HadamSplit(network_params.M,

File ~\Anaconda3\envs\without_dll\Lib\site-packages\spyrit\core\meas.py:861 in init
super().init(F, pinv=False, Ord=Ord, meas_shape=(h, h))

File ~\Anaconda3\envs\without_dll\Lib\site-packages\spyrit\core\meas.py:699 in init
super().init(H, pinv, rtol, Ord, meas_shape)

File ~\Anaconda3\envs\without_dll\Lib\site-packages\spyrit\core\meas.py:482 in init
super().init(H, Ord, meas_shape)

File ~\Anaconda3\envs\without_dll\Lib\site-packages\spyrit\core\meas.py:62 in init
H_static, ind = spytorch.sort_by_significance(

File ~\Anaconda3\envs\without_dll\Lib\site-packages\spyrit\core\torch.py:586 in sort_by_significance
indices = torch.argsort(-sig.flatten(), stable=True).to(torch.int32)

TypeError: argsort() received an invalid combination of arguments - got (numpy.ndarray, stable=bool), but expected one of:

  • (Tensor input, *, bool stable, int dim = -1, bool descending = False)
  • (Tensor input, int dim = -1, bool descending = False)
  • (Tensor input, name dim, bool descending = False)
@nducros nducros added the bug Something isn't working label Oct 18, 2024
@romainphan
Copy link
Collaborator

Corrected in #19, awaiting review

@romainphan
Copy link
Collaborator

@Mahieu-Williame il faut changer les arguments que tu passes à Spyrit de numpy.ndarray dans les scripts que tu utilises. Par exemple:

Sampling_map = torch.zeros(h, h)
M_xy = math.ceil(M**0.5)
Sampling_map[:M_xy, :M_xy] = 1

au lieu de

Sampling_map = np.zeros((h, h))
etc

tbaudier added a commit that referenced this issue Nov 18, 2024
correcting numpy issue (spas: Update numpy #18)
@nducros
Copy link
Member Author

nducros commented Nov 22, 2024

Je fais des tests à partir du script fig8_recon.py de ce repo

Est-ce vis à vis de numpy que l'on impose matplotlib==3.7.5 ? Si oui, quel était le soucis avec numpy ?

  • Partant de numpy 2.1.3, l'installation de spas conduit à revenir à la 1.26.4 (via le requirement de matplotlib?).
  • J'ai crée cette branche. Partant de numpy 2.1.3, l'installation de spas retrograde seulement à 2.0.6, mais je ne comprends pas pourquoi.

Dans les 2 cas, je peux charger spas et mon code tourne.

@nducros nducros reopened this Nov 22, 2024
@nducros
Copy link
Member Author

nducros commented Dec 4, 2024

@Mahieu-Williame
La branche main est maintenant compatible avec numpy v2 et marche sans DLL.
Quand c'est OK pour toi, on la tague.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants