Closed benlonnqvist closed 5 months ago
related: http://braintree.mit.edu:8080/job/unittest_plugins/928/console
brainscore_vision/model_helpers/generic_plugin_tests.py::test_identifier[vit-base-patch16-224-in21k_debug0118] FAILED [ 20%]
brainscore_vision/model_helpers/generic_plugin_tests.py::test_visual_degrees[vit-base-patch16-224-in21k_debug0118] FAILED [ 40%]
brainscore_vision/model_helpers/generic_plugin_tests.py::test_start_task_or_recording[vit-base-patch16-224-in21k_debug0118] FAILED [ 60%]
brainscore_vision/model_helpers/generic_plugin_tests.py::test_look_at_behavior_probabilities[vit-base-patch16-224-in21k_debug0118] FAILED [ 80%]
brainscore_vision/model_helpers/generic_plugin_tests.py::test_look_at_neural_V1[vit-base-patch16-224-in21k_debug0118] FAILED [100%]
...
logger = <Logger brainscore_vision.models.vit.model.PytorchWrapperV2 (INFO)>
def __init__(self, model, preprocessing, identifier=None, forward_kwargs=None, *args, **kwargs):
import torch
logger = logging.getLogger(fullname(self))
self._device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
logger.debug(f"Using device {self._device}")
self._model = model
> self._model = self._model.to(self._device)
E AttributeError: 'str' object has no attribute 'to'
brainscore_vision/model_helpers/activations/pytorch.py:20: AttributeError
The issue is that the PytorchWrapperV2
defined in the vit
plugin passes arguments positionally to the super-class:
https://github.com/brain-score/vision/blob/master/brainscore_vision/models/vit/model.py#L67-L69
which expects the model
and not the identifier
first:
https://github.com/brain-score/vision/blob/master/brainscore_vision/models/vit/model.py#L67-L69
to actually answer the original question: the transformers
dependency is specified here https://github.com/brain-score/vision/blob/master/brainscore_vision/models/vit/setup.py#L9
@benlonnqvist reverting PR 515 now. let me know if you need help resubmitting!
515 introduced the model
vit
which requires thetransformers
package, buttransformers
is not included in the brain-score/visionpyproject.toml
nor themodels/vit/requirements.txt
file. If the requirement exists somewhere else and I missed it, apologies!