You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello,
I am currently working with the zhihan1996/DNABERT-2-117M model to extract features from DNA sequences and am encountering an issue with accessing the hidden states of the model.
Issue Description
Despite setting return_dict=True and output_hidden_states=True, the output from the model remains a tuple rather than the expected ModelOutput object that includes the .hidden_states attribute. When attempting to access outputs.hidden_states, I encounter the following error:
AttributeError: 'tuple' object has no attribute 'hidden_states'
Additionally, I have used the following code to check the type and attributes of the output object, confirming that it indeed returns a tuple, which lacks the ' hidden_states ':
print(type(outputs))
print(dir(outputs))
Environment Setup
Transformers version: 4.29.2 (as specified in the requirements.txt)
I would appreciate any guidance or suggestions on how to resolve this issue. Thank you for your time and assistance!
The text was updated successfully, but these errors were encountered:
Thank you so much for your assistance!
I will proceed to update the transformer to the version you suggested.
By the way, could you please let me know if there are any other version dependencies that I should be aware of?
Your guidance is greatly appreciated!
Hello,
I am currently working with the zhihan1996/DNABERT-2-117M model to extract features from DNA sequences and am encountering an issue with accessing the hidden states of the model.
Issue Description
Despite setting return_dict=True and output_hidden_states=True, the output from the model remains a tuple rather than the expected ModelOutput object that includes the .hidden_states attribute. When attempting to access outputs.hidden_states, I encounter the following error:
AttributeError: 'tuple' object has no attribute 'hidden_states'
Additionally, I have used the following code to check the type and attributes of the output object, confirming that it indeed returns a tuple, which lacks the ' hidden_states ':
print(type(outputs))
print(dir(outputs))
Environment Setup
Transformers version: 4.29.2 (as specified in the requirements.txt)
I would appreciate any guidance or suggestions on how to resolve this issue. Thank you for your time and assistance!
The text was updated successfully, but these errors were encountered: