Giter Site home page Giter Site logo

Comments (3)

dallatt avatar dallatt commented on May 29, 2024

Hello @felbecker ,

HuggingFace automatically converts the models to tensorflow safetensors. We just updated the repositories with them, you can find one of the v2 model's tensorflow version here.

Best regards,

Hugo

from nucleotide-transformer.

felbecker avatar felbecker commented on May 29, 2024

Great, thanks!

from nucleotide-transformer.

LarsGab avatar LarsGab commented on May 29, 2024

Hi,

I encountered an issue while loading the tensorflow weights for the v2 model, I tried to load them in two ways:

  1. Using TFAutoModelForMaskedLM (safe_tensors and trust_remote_code enabeled). I got following error:
ValueError: Unrecognized configuration class <class 'transformers_modules.InstaDeepAI.nucleotide-transformer-v2-50m-multi-species.af10a726a544d702d43e1de84548c7f1bc30cc8f.esm_config.EsmConfig'> for this kind of AutoModel: TFAutoModelForMaskedLM.
  1. Using TFEsmForMaskedLM, I got:
Traceback (most recent call last):
  File "/opt/conda/lib/python3.9/site-packages/transformers/modeling_tf_pytorch_utils.py", line 348, in load_pytorch_state_dict_in_tf2_model
    array = apply_transpose(transpose, array, symbolic_weight.shape)
  File "/opt/conda/lib/python3.9/site-packages/transformers/modeling_tf_pytorch_utils.py", line 143, in apply_transpose
    weight = reshape(weight, match_shape)
  File "/opt/conda/lib/python3.9/site-packages/transformers/utils/generic.py", line 620, in reshape
    return tf.reshape(array, newshape)
  File "/opt/conda/lib/python3.9/site-packages/tensorflow/python/util/traceback_utils.py", line 153, in error_handler
    raise e.with_traceback(filtered_tb) from None
  File "/opt/conda/lib/python3.9/site-packages/tensorflow/python/eager/execute.py", line 54, in quick_execute
    tensors = pywrap_tfe.TFE_Py_Execute(ctx._handle, device_name, op_name,
tensorflow.python.framework.errors_impl.InvalidArgumentError: {{function_node __wrapped__Reshape_device_/job:localhost/replica:0/task:0/device:GPU:0}} Input to reshape is a tensor with 2097152 values, but the requested shape has 1048576 [Op:Reshape]

Is there a different way to load the model? Thanks for your help!
Best,
Lars

from nucleotide-transformer.

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.