RosettaCommons / RoseTTAFold

This package contains deep learning models and related scripts for RoseTTAFold
MIT License
2.03k stars 440 forks source link

File permissions error when running on shared filesystem #120

Open james-vincent opened 2 years ago

james-vincent commented 2 years ago

run_e2e_ver.sh is trying to create cache directory in the RRoseTTAFold install directory. This is not possible on a shared system (HPC). I wonder how others are able to do run like this?

Reading CRF from K4000.crf ... Adding cs-pseudocounts ... Effective number of sequences exp(entropy) = 11.30 Wrote profile with 779 columns as checkpoint file to t000_.msa0.tmp.chk Using backend: pytorch /programs/x86_64-linux/rosettafold/1.1.0/RoseTTAFold/network/predict_e2e.py:161: DeprecationWarning: np.bool is a deprecated alias for the builtin bool. To silence this warning, use bool by itself. Doing this will not modify any behavior and is safe. If you specifically wanted the numpy scalar type, use np.bool_ here. Deprecated in NumPy 1.20; for more details and guidance: https://numpy.org/devdocs/release/1.20.0-notes.html#deprecations sel = np.zeros((L)).astype(np.bool) Traceback (most recent call last): File "/programs/x86_64-linux/rosettafold/1.1.0/RoseTTAFold/network/predict_e2e.py", line 324, in pred.predict(args.a3m_fn, args.out_prefix, args.hhr, args.atab) File "/programs/x86_64-linux/rosettafold/1.1.0/RoseTTAFold/network/predict_e2e.py", line 178, in predict logit_s, node, init_crds, pred_lddt = self.model(input_msa, input_seq, input_idx, t1d=input_t1d, t2d=input_t2d, return_raw=True) File "/programs/x86_64-linux/rosettafold/1.1.0/mamba/envs/RoseTTAFold/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(*input, **kwargs) File "/nfs/programs-dev/x86_64-linux/rosettafold/1.1.0/RoseTTAFold/network/RoseTTAFoldModel.py", line 112, in forward msa, pair, xyz, lddt = self.feat_extractor(msa, pair, seq1hot, idx) File "/programs/x86_64-linux/rosettafold/1.1.0/mamba/envs/RoseTTAFold/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(*input, **kwargs) File "/nfs/programs-dev/x86_64-linux/rosettafold/1.1.0/RoseTTAFold/network/Attention_module_w_str.py", line 476, in forward msa, pair, xyz = self.iter_block_2[i_m](msa, pair, xyz, seq1hot, idx, top_k=top_ks[i_m]) File "/programs/x86_64-linux/rosettafold/1.1.0/mamba/envs/RoseTTAFold/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(*input, **kwargs) File "/nfs/programs-dev/x86_64-linux/rosettafold/1.1.0/RoseTTAFold/network/Attention_module_w_str.py", line 363, in forward xyz, state = self.str2str(msa.float(), pair.float(), xyz.float(), seq1hot, idx, top_k=top_k) File "/programs/x86_64-linux/rosettafold/1.1.0/mamba/envs/RoseTTAFold/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(*input, **kwargs) File "/programs/x86_64-linux/rosettafold/1.1.0/mamba/envs/RoseTTAFold/lib/python3.8/site-packages/torch/cuda/amp/autocast_mode.py", line 139, in decorate_autocast return func(args, **kwargs) File "/nfs/programs-dev/x86_64-linux/rosettafold/1.1.0/RoseTTAFold/network/Attention_module_w_str.py", line 241, in forward shift = self.se3(G, msa.reshape(BL, -1, 1), l1_feats) File "/programs/x86_64-linux/rosettafold/1.1.0/mamba/envs/RoseTTAFold/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl result = self.forward(*input, **kwargs) File "/programs/x86_64-linux/rosettafold/1.1.0/mamba/envs/RoseTTAFold/lib/python3.8/site-packages/torch/cuda/amp/autocast_mode.py", line 139, in decorate_autocast return func(*args, **kwargs) File "/nfs/programs-dev/x86_64-linux/rosettafold/1.1.0/RoseTTAFold/network/SE3_network.py", line 104, in forward basis, r = get_basis_and_r(G, self.num_degrees-1) File "/nfs/programs-dev/x86_64-linux/rosettafold/1.1.0/RoseTTAFold/network/equivariant_attention/modules.py", line 102, in get_basis_and_r basis = get_basis(G, max_degree, compute_gradients) File "/nfs/programs-dev/x86_64-linux/rosettafold/1.1.0/RoseTTAFold/network/equivariant_attention/modules.py", line 61, in get_basis Q_J = utils_steerable._basis_transformation_Q_J(J, d_in, d_out) File "/nfs/programs-dev/x86_64-linux/rosettafold/1.1.0/RoseTTAFold/network/equivariant_attention/from_se3cnn/cache_file.py", line 68, in wrapper os.makedirs(dirname) File "/programs/x86_64-linux/rosettafold/1.1.0/mamba/envs/RoseTTAFold/lib/python3.8/os.py", line 223, in makedirs mkdir(name, mode) PermissionError: [Errno 13] Permission denied: '/nfs/programs-dev/x86_64-linux/rosettafold/1.1.0/RoseTTAFold/network/equivariant_attention/from_se3cnn/cache/trans_Q'

zemu-unile commented 2 years ago

We are running a patched version that uses the home directory as cache instead. Maybe this patch will help you

Changes the cache directory path from the installation directory to the users home directory
to avoid a crash due to insufficient permissions.
author: Christoph Siegert (Leipzig University)

diff -ruN RoseTTAFold.orig/network/equivariant_attention/from_se3cnn/utils_steerable.py RoseTTAFold/network/equivariant_attention/from_se3cnn/utils_steerable.py
--- RoseTTAFold.orig/network/equivariant_attention/from_se3cnn/utils_steerable.py       2021-08-16 12:54:05.769231102 +0200
+++ RoseTTAFold/network/equivariant_attention/from_se3cnn/utils_steerable.py    2021-08-18 16:17:10.653216846 +0200
@@ -33,7 +33,7 @@
     return get_matrix_kernel(torch.cat(As, dim=0), eps)

-@cached_dirpklgz("%s/cache/trans_Q"%os.path.dirname(os.path.realpath(__file__)))
+@cached_dirpklgz("%s/.cache/trans_Q"%os.path.expanduser('~'))
 def _basis_transformation_Q_J(J, order_in, order_out, version=3):  # pylint: disable=W0613
     """
     :param J: order of the spherical harmonics

I could open a PR for this if there is more interest.

james-vincent commented 2 years ago

Yes, please do open a PR. We would love to have this implemented. I'm not sure how anyone deploys to a shared system otherwise.