tensorflow / model-card-toolkit

A toolkit that streamlines and automates the generation of model cards
https://www.tensorflow.org/responsible_ai/model_card_toolkit/guide
Apache License 2.0
423 stars 84 forks source link

Add support for apple silicon #264

Open yingding opened 1 year ago

yingding commented 1 year ago

I tried to install model-card-toolkit with python 3.10 and the following packages on my m1 max MBP.

tensorflow-macos==2.11.0
tensorflow-metal==0.7.1
pandas==1.5.3
scikit-learn==1.2.2
model-card-toolkit

got the following error

The conflict is caused by:
    model-card-toolkit 1.3.2 depends on ml-metadata<1.6.0 and >=1.5.0
    model-card-toolkit 1.3.1 depends on ml-metadata<1.6.0 and >=1.5.0
    model-card-toolkit 1.3.0 depends on ml-metadata<1.6.0 and >=1.5.0
    model-card-toolkit 1.2.0 depends on ml-metadata<1.6.0 and >=1.5.0
    tensorflow-macos 2.11.0 depends on absl-py>=1.0.0
    model-card-toolkit 1.1.0 depends on absl-py<0.11 and >=0.9
    model-card-toolkit 1.0.0 depends on tensorflow-data-validation<0.27.0 and >=0.26.0
    model-card-toolkit 0.1.3 depends on tensorflow-data-validation<0.27.0 and >=0.26.0
    model-card-toolkit 0.1.2 depends on tensorflow-data-validation<0.27.0 and >=0.26.0
    tensorflow-macos 2.11.0 depends on absl-py>=1.0.0
    model-card-toolkit 0.1.1 depends on absl-py<0.9 and >=0.7
    tensorflow-macos 2.11.0 depends on absl-py>=1.0.0
    model-card-toolkit 0.1.0 depends on absl-py<0.9 and >=0.7

To fix this you could try to:
1. loosen the range of package versions you've specified
2. remove package versions to allow pip attempt to solve the dependency conflict

ERROR: ResolutionImpossible: for help visit https://pip.pypa.io/en/latest/topics/dependency-resolution/#dealing-with-dependency-conflicts

Is there anyway to get this to work on apple M1/M2 silicon?

codesue commented 1 year ago

Thank you for reporting this issue, @yingding!

The next model-card-toolkit release (2.0.0) will require absl-py>=0.9,<1.1 and tensorflow-data-validation>=1.5.0,<2.0.0. Unfortunately, this alone won't resolve the issue since ml-metadata does not support Apple Silicon, and we don't have an ETA for when it will. A suggested workaround in the linked issue is to build MLMD from source. Separately, we can explore making MLMD an optional dependency as part of #93.

yingding commented 1 year ago

Thanks so much, I am looking forward to the 2.0.0 release. It seems like model-card-toolkit is also waiting for the tfx-bsl.