jertubiana / ScanNet

Apache License 2.0
115 stars 28 forks source link

tensorflow-gpu version #2

Closed wenyuhaokikika closed 2 years ago

wenyuhaokikika commented 2 years ago

Hi, very nice work indeed! can you provide your tensorflow-gpu version? i encounter some problem when I try use ScanNet to run demo.

install

git clone https://github.com/jertubiana/ScanNet.git
cd ScanNet
conda create -n py_scannet python=3.6.12
conda activate py_scannet

i delete row tensorflow==1.14.0 in requirements.txt because i want use gpu. then i install packages with pip install -r requirements.txt;pip install tensorflow-gpu.

version in my environment

Package Version

----------------------- -----------

absl-py 0.15.0

argon2-cffi 21.3.0

argon2-cffi-bindings 21.2.0

astunparse 1.6.3

async-generator 1.10

attrs 22.1.0

backcall 0.2.0

biopython 1.78

bleach 4.1.0

cached-property 1.5.2

cachetools 4.2.4

certifi 2022.6.15

cffi 1.15.1

charset-normalizer 2.0.12

clang 5.0

cycler 0.11.0

dataclasses 0.8

decorator 5.1.1

defusedxml 0.7.1

entrypoints 0.4

flatbuffers 1.12

gast 0.4.0

google-auth 1.35.0

google-auth-oauthlib 0.4.6

google-pasta 0.2.0

grpcio 1.47.0

h5py 3.1.0

idna 3.3

importlib-metadata 4.8.3

ipydatawidgets 4.3.1.post1

ipykernel 5.5.6

ipython 7.16.3

ipython-genutils 0.2.0

ipywebrtc 0.5.0

ipywidgets 7.5.1

jedi 0.17.2

Jinja2 3.0.3

joblib 1.1.0

jsonschema 3.2.0

jupyter-client 7.1.2

jupyter-core 4.9.2

jupyterlab-pygments 0.1.2

keras 2.6.0

Keras-Applications 1.0.8

Keras-Preprocessing 1.1.2

kiwisolver 1.3.1

llvmlite 0.35.0

Markdown 3.3.7

MarkupSafe 2.0.1

matplotlib 3.3.3

mistune 0.8.4

nbclient 0.5.9

nbconvert 6.0.7

nbformat 5.1.3

nest-asyncio 1.5.5

notebook 6.4.10

numba 0.52.0

numpy 1.19.5

oauthlib 3.2.0

opt-einsum 3.3.0

packaging 21.3

pandas 1.1.5

pandocfilters 1.5.0

parso 0.7.1

pexpect 4.8.0

pickleshare 0.7.5

Pillow 8.4.0

pip 21.3.1

prometheus-client 0.14.1

prompt-toolkit 3.0.30

protobuf 3.19.4

ptyprocess 0.7.0

pyasn1 0.4.8

pyasn1-modules 0.2.8

pycparser 2.21

Pygments 2.13.0

pyparsing 3.0.9

pyrsistent 0.18.0

python-dateutil 2.8.2

pythreejs 2.3.0

pytz 2022.2.1

PyYAML 6.0

pyzmq 23.2.1

requests 2.27.1

requests-oauthlib 1.3.1

rsa 4.9

scikit-learn 0.24.2

scipy 1.5.4

Send2Trash 1.8.0

setuptools 58.0.4

six 1.15.0

tensorboard 2.6.0

tensorboard-data-server 0.6.1

tensorboard-plugin-wit 1.8.1

tensorflow-estimator 2.6.0

tensorflow-gpu 2.6.2

termcolor 1.1.0

terminado 0.12.1

testpath 0.6.0

threadpoolctl 3.1.0

tornado 6.1

traitlets 4.3.3

traittypes 0.2.1

typing-extensions 3.7.4.3

urllib3 1.26.12

wcwidth 0.2.5

webencodings 0.5.1

Werkzeug 2.0.3

wheel 0.37.1

widgetsnbextension 3.5.2

wrapt 1.12.1

zipp 3.6.0

run

then i run python predict_bindingsites.py P38398 --noMSA, it raise exception

  File "predict_bindingsites.py", line 406, in predict_interface_residues
    model_obj = wrappers.load_model(model_folder + model, Lmax=Lmax)
  File "/data/wenyuhao/code/ScanNet/utilities/wrappers.py", line 80, in load_model
    model_builder, *model_args, **model_kwargs, backend=backend, **wrapper_builder_kwargs)
  File "/data/wenyuhao/code/ScanNet/utilities/wrappers.py", line 217, in __init__
    model_builder, *args, backend=backend, **kwargs)
  File "/data/wenyuhao/code/ScanNet/utilities/wrappers.py", line 95, in __init__
    self.model = self.model_builder(*self.args, **self.kwargs)
  File "/data/wenyuhao/code/ScanNet/network/scannet.py", line 351, in ScanNet
    embedded_attributes_aa = attribute_embedding(masked_attributes_aa,nembedding_aa,activation,name='embedded_attributes_aa')
  File "/data/wenyuhao/code/ScanNet/network/scannet.py", line 90, in attribute_embedding
    name=name)
  File "/data/wenyuhao/code/ScanNet/network/scannet.py", line 69, in addNonLinearity
    epsilon=1e-3, axis=-1, center=center, scale=scale, name=name + '_normalization')(input_layer) # Custom batch norm layer that takes into account the mask.
  File "/data/wenyuhao/anaconda3/envs/py_scannet/lib/python3.6/site-packages/keras/engine/base_layer.py", line 977, in __call__
    input_list)
  File "/data/wenyuhao/anaconda3/envs/py_scannet/lib/python3.6/site-packages/keras/engine/base_layer.py", line 1115, in _functional_construction_call
    inputs, input_masks, args, kwargs)
  File "/data/wenyuhao/anaconda3/envs/py_scannet/lib/python3.6/site-packages/keras/engine/base_layer.py", line 848, in _keras_tensor_symbolic_call
    return self._infer_output_signature(inputs, args, kwargs, input_masks)
  File "/data/wenyuhao/anaconda3/envs/py_scannet/lib/python3.6/site-packages/keras/engine/base_layer.py", line 888, in _infer_output_signature
    outputs = call_fn(inputs, *args, **kwargs)
  File "/data/wenyuhao/anaconda3/envs/py_scannet/lib/python3.6/site-packages/tensorflow/python/autograph/impl/api.py", line 695, in wrapper
    raise e.ag_error_metadata.to_exception(e)
TypeError: in user code:

    /data/wenyuhao/code/ScanNet/network/embeddings.py:464 call  *
        del reduction_axes[self.axis]

    TypeError: list indices must be integers or slices, not ListWrapper

because of value axis of the object MaskedBatchNormalization is ListWrapper in /network/embeddings.py:464 . maybe version of tensorflow-gpu is not matched. it really make confused , run in centos7. Looking forward to.

jertubiana commented 2 years ago

Hi, Thanks for your interest in our research! Sorry for the issue, the right tensorflow-gpu version is tensorflow-gpu==1.14. Please let me know if that works for you. Best regards, Jérôme

On 30 Aug 2022, at 5:24, wenyuhao @.***> wrote:

Hi, very nice work indeed! can you provide your tensorflow-gpu version? i encounter some problem when I try use ScanNet to run demo.

install

git clone https://github.com/jertubiana/ScanNet.git cd ScanNet conda create -n py_scannet python=3.6.12 conda activate py_scannet i delete row tensorflow==1.14.0 in requirements.txt because i want use gpu. then i install packages with pip install -r requirements.txt;pip install tensorflow-gpu.

version in my environment run

then i run python predict_bindingsites.py P38398 --noMSA, it raise exception

File "predict_bindingsites.py", line 406, in predict_interface_residues model_obj = wrappers.load_model(model_folder + model, Lmax=Lmax) File "/data/wenyuhao/code/ScanNet/utilities/wrappers.py", line 80, in load_model model_builder, model_args, model_kwargs, backend=backend, wrapper_builder_kwargs) File "/data/wenyuhao/code/ScanNet/utilities/wrappers.py", line 217, in init model_builder, args, backend=backend, kwargs) File "/data/wenyuhao/code/ScanNet/utilities/wrappers.py", line 95, in init self.model = self.model_builder(*self.args, *self.kwargs) File "/data/wenyuhao/code/ScanNet/network/scannet.py", line 351, in ScanNet embedded_attributes_aa = attribute_embedding(masked_attributes_aa,nembedding_aa,activation,name='embedded_attributes_aa') File "/data/wenyuhao/code/ScanNet/network/scannet.py", line 90, in attribute_embedding name=name) File "/data/wenyuhao/code/ScanNet/network/scannet.py", line 69, in addNonLinearity epsilon=1e-3, axis=-1, center=center, scale=scale, name=name + '_normalization')(input_layer) # Custom batch norm layer that takes into account the mask. File "/data/wenyuhao/anaconda3/envs/py_scannet/lib/python3.6/site-packages/keras/engine/base_layer.py", line 977, in call input_list) File "/data/wenyuhao/anaconda3/envs/py_scannet/lib/python3.6/site-packages/keras/engine/base_layer.py", line 1115, in _functional_construction_call inputs, input_masks, args, kwargs) File "/data/wenyuhao/anaconda3/envs/py_scannet/lib/python3.6/site-packages/keras/engine/base_layer.py", line 848, in _keras_tensor_symbolic_call return self._infer_output_signature(inputs, args, kwargs, input_masks) File "/data/wenyuhao/anaconda3/envs/py_scannet/lib/python3.6/site-packages/keras/engine/base_layer.py", line 888, in _infer_output_signature outputs = call_fn(inputs, args, kwargs) File "/data/wenyuhao/anaconda3/envs/py_scannet/lib/python3.6/site-packages/tensorflow/python/autograph/impl/api.py", line 695, in wrapper raise e.ag_error_metadata.to_exception(e) TypeError: in user code:

/data/wenyuhao/code/ScanNet/network/embeddings.py:464 call  *
    del reduction_axes[self.axis]

TypeError: list indices must be integers or slices, not ListWrapper

because of value the object MaskedBatchNormalization is ListWrapper in /network/embeddings.py:464 . maybe version of tensorflow-gpu is not matched. it really make confused , run in centos7. Looking forward to.

— Reply to this email directly, view it on GitHub https://github.com/jertubiana/ScanNet/issues/2, or unsubscribe https://github.com/notifications/unsubscribe-auth/ACHSPJR4CDTMYAI2GPE5AVLV3V5GLANCNFSM5776ORXQ. You are receiving this because you are subscribed to this thread.

wenyuhaokikika commented 2 years ago

Thank you! it works for me after installing tensorflow-gpu==1.14!!! very nice work.

And i will get some numba warinings,such as

/data/wenyuhao/anaconda3/envs/py_scannet/lib/python3.6/site-packages/numba/typed/typedlist.py:66: NumbaPendingDeprecationWarning: 
Encountered the use of a type that is scheduled for deprecation: type 'reflected list' found for argument 'item' of function 'impl_append.<locals>.impl'.

For more information visit https://numba.pydata.org/numba-doc/latest/reference/deprecation.html#deprecation-of-reflection-for-list-and-set-types

File "../../anaconda3/envs/py_scannet/lib/python3.6/site-packages/numba/typed/listobject.py", line 597:

    def impl(l, item):
    ^

  l.append(item)

i think it also because of version of numba mismatch,can i see your full requenirment.txt in your environment? Thank you.