[Python] Cannot run ProtNLM from Uniprot with Tensorflow in colab notebook

Discussão em 'Python' iniciado por Stack, Março 3, 2025.

  1. Stack

    Stack Membro Participativo

    I am interested in running Uniprot's Protein descriptor model, ProtNLM, to add some bonus descriptors for a big chunk of protein sequence I have.

    They have a trial notebook available here that I demoed in mid-February without issue. I believe I had to change the lines

    !python3 -m pip install -q -U tensorflow==2.8.2
    !python3 -m pip install -q -U tensorflow-text==2.8.2


    to be >=2.8.2 since the 2.8.2 version couldn't be installed, but I was able to predict some proteins and show it off.

    Now, when I login to this demo notebook, I can't run the model whatsoever. The third cell, which intakes the sequence, can't find the run_inference() function:

    NameError
    Traceback (most recent call last)

    <ipython-input-5-4a7325a0e004> in <cell line: 0>()
    8 sequence = sequence.replace(' ', '')
    9
    ---> 10 names, scores = run_inference(sequence)
    11
    12 for name, score, i in zip(names, scores, range(len(names))):

    NameError: name 'run_inference' is not defined


    I didn't see this function defined in the notebook, so I assumed it was internal to tensorflow (maybe only version 2.8.2, but I couldn't find anything in searching docs), or otherwise loaded with the model.

    How can I get this script running again?

    Continue reading...

Compartilhe esta Página