Code Monkey home page Code Monkey logo

Comments (6)

jharrymoore avatar jharrymoore commented on August 29, 2024 1

Great, can I confirm your installation works as expected now? Thank you for the comment on the docs - this command has been updated now

from mace.

jharrymoore avatar jharrymoore commented on August 29, 2024

Could you try building the conda environment from this file? Then you should be able to run the pip install commands from the docs.

You need our forks of both openmmtools and openmm-torch to be compatible with MACE

from mace.

1234zou avatar 1234zou commented on August 29, 2024

Thanks, @jharrymoore . It works with the file mace-openmm.yml. However, torchvision and torchaudio is not included in this .yml file. If I install them via pip install, pytorch-2.0.1 will be downloaded and installed. But pytorch-2.0.0 is already written in this .yml file. Would you please tell me how to install torchvision and torchaudio in such case?

By the way, there is a sklearn in the file openmmtools/openmm_torch/repex.py,

from sklearn.random_projection import sample_without_replacement

But I look into this file and find sample_without_replacement is not used at all. So this line is supposed to be deleted. Otherwise it will lead to errors when I run mace-md.

from mace.

1234zou avatar 1234zou commented on August 29, 2024

There two ways of installing MACE from documentation or github README, the first is

mamba env create -f mace-openmm.yml
pip install git+https://github.com/ACEsuit/mace.git

which does not require torchvision or torchaudio.

The second is

pip install torch==2.0.1 torchvision==0.15.2 torchaudio==2.0.2 --index-url https://download.pytorch.org/whl/cu118
pip install mace-torch

which requires torchvision and torchaudio.

Currently I choose the 1st way to install MACE. It leads to python=3.10.12, pytorch=2.0.0.post304. But when I run the mace-md using

mace-md -f ejm_31.sdf --ml_mol ejm_31.sdf --model_path MACE-OFF23_small.model --output_dir md_test --nl torch --steps 1000 --minimiser ase --dtype float64 --remove_cmm --unwrap

The error is

Traceback (most recent call last):
  File "/public/home/jxzou/software/anaconda3/envs/mace-openmm/bin/mace-md", line 8, in <module>
    sys.exit(main())
  File "/public/home/jxzou/software/anaconda3/envs/mace-openmm/lib/python3.10/site-packages/openmmtools/scripts/mace_md.py", line 245, in main
    system = PureSystem(
  File "/public/home/jxzou/software/anaconda3/envs/mace-openmm/lib/python3.10/site-packages/openmmtools/openmm_torch/hybrid_md.py", line 953, in __init__
    self.create_system(ml_mol=ml_mol, model_path=model_path)
  File "/public/home/jxzou/software/anaconda3/envs/mace-openmm/lib/python3.10/site-packages/openmmtools/openmm_torch/hybrid_md.py", line 970, in create_system
    tmp_model = torch.load(model_path, map_location="cpu")
  File "/public/home/jxzou/software/anaconda3/envs/mace-openmm/lib/python3.10/site-packages/torch/serialization.py", line 815, in load
    return _legacy_load(opened_file, map_location, pickle_module, **pickle_load_args)
  File "/public/home/jxzou/software/anaconda3/envs/mace-openmm/lib/python3.10/site-packages/torch/serialization.py", line 1033, in _legacy_load
    magic_number = pickle_module.load(f, **pickle_load_args)
_pickle.UnpicklingError: invalid load key, '{'.

@jharrymoore Would you please take a look at this? Thanks!

from mace.

jharrymoore avatar jharrymoore commented on August 29, 2024

I don't believe we depend on torchvision or torch audio packages in mace or through mace-md. Do you need these in your environment for some other reason?

If you are planning on running MD with mace via openmm, you must build the environment via the yaml file, since this ensures the torch binaries from conda forge are compatible with openmm - this is not guaranteed when installing via pip.

On the unpicking error, this normally indicates your model did not download properly, could you inspect the downloaded file and check this looks like a model file (should be several MB in size)

from mace.

1234zou avatar 1234zou commented on August 29, 2024

Thank you for your quick response. Yes, the torchvision or torchaudio is not needed. I was reading here and it says about torchvision and torchaudio. Later I use the file mace-openmm.yml and the installation goes well.

And yes, the file MACE-OFF23_small.model is incomplete. It was my internet connection problem. This file should be about 7MB.

By the way, it seems that in the documentation --nl torch_nl should be modified into --nl torch now.

Best,
Jingxiang

from mace.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.