matchms / ms2deepscore

Deep learning similarity measure for comparing MS/MS spectra with respect to their chemical similarity
Apache License 2.0
48 stars 22 forks source link

Mac 1 chip results in wrong results #199

Closed niekdejonge closed 4 months ago

niekdejonge commented 5 months ago

@kevinmildau notified me that there was a potential issue with the M1 chip. The predictions are notably different when run on an macos with M1 chip compared to windows, without any warnings or errors.

The M1 chip is made compatible by installing tensorflow-macos (instead of tensorflow) This made it run on macos with M1 chip, unfortunately, automatic testing of the M1 chip is not available yet on github actions. So we would not notice if this is the case.

kevinmildau commented 5 months ago

Using a conda environment with python 3.8 and pytest 8.0.0 on macbook Pro M1 Pro from 2021

image

kevinmildau commented 5 months ago

As Niek mentioned, I get a similarity matrix from ms2deepscore but it does not agree with the one I get in the equivalent windows run. No error messages or detectable problems. The scores seem to tend towards higher values in the macos run. Since the model files I use are the same ( https://zenodo.org/records/10527997 ) the problem might lie in the predict step?

niekdejonge commented 5 months ago

Proposed short term solution: Remove tensorflow-macos in setup.py. This will make it impossible to install on macos systems with the M1 chip.

Long term solution: We switched to pytorch, which is hopefully better compatible with the M1 chip.

florian-huber commented 4 months ago

Fixed with #200 (and even more so with version 2.0).