Comments (4)
I think both of your snippets are reproducible @datumbox and @laurahanu . Looks like the difference lies in whether transformers
is manually imported or not:
In [1]: import importlib
In [2]: importlib.util.find_spec("transformers") is not None
Out[2]: True
In [3]: import transformers
In [4]: importlib.util.find_spec("transformers") is not None
---------------------------------------------------------------------------
ValueError Traceback (most recent call last)
<ipython-input-4-6fdb35471f82> in <module>
----> 1 importlib.util.find_spec("transformers") is not None
~/opt/miniconda3/envs/pt/lib/python3.8/importlib/util.py in find_spec(name, package)
112 else:
113 if spec is None:
--> 114 raise ValueError('{}.__spec__ is None'.format(name))
115 return spec
116
ValueError: transformers.__spec__ is None
This looks like something specific to the transformers
package though, it doesn't happen e.g. with numpy:
In [5]: importlib.util.find_spec("numpy") is not None
Out[5]: True
In [6]: import numpy
In [7]: importlib.util.find_spec("numpy") is not None
Out[7]: True
I'm not sure what the issue might be TBH, but @laurahanu I would suggest reporting the issue to the transformers
package to see what their input might be?
from hub.
Hi @NicolasHug thanks for looking into this as well, that's interesting!
I have actually reported it to them too as it seems like they indeed do not have a __spec__
explicitly defined.
It does look like it's an issue specific to them though so will close this.
from hub.
Thanks for reporting.
As far as I understand, using importlib.util.find_spec()
is the recommended way in the latest Python versions for checking if a module exists.
I tried to reproduce the problem, but I am unable:
$ pip install transformers
Requirement already satisfied: ./python3.8/site-packages (4.9.2)
$ python
>>> import importlib
>>> importlib.util.find_spec("transformers") is not None
True
Could you confirm that the transformers
is properly installed? Try importing the library and calling find_spec
to see what you get.
from hub.
Thank you for looking into this!
That's strange. I've tried different environments and I seem to get this error every time:
from hub.
Related Issues (20)
- Colab tutoral doesn't work
- Reported accuracy mismatch for `vgg11_bn` HOT 2
- Failing CI jobs HOT 1
- Reported accuracies may go outdated
- Extension of Torch Hub HOT 1
- Failed in running Tacotron2(NVIDA) HOT 2
- Imagenet Pytorch Model Classes serial vs HF imagenet dataset classes serial HOT 1
- Need help on how to contribute HOT 4
- improved yolov5 HOT 2
- failed CI test
- Proposal for consistency in wording `ImageNet` HOT 3
- using static dowloaded .pt small model for predictionas , encountering this isssue : prediction = midas(input_batch) TypeError: 'collections.OrderedDict' object is not callable HOT 1
- Links broken on Pytorch-Transformers page HOT 3
- Hi
- Training deeplabv3_resnet50 help
- How to load a custom YOLOv9 model using torch.hub.load()? HOT 1
- why my model is not showing in the pytorch website HOT 2
- wants to contribute and publish an image classification model. HOT 2
- recheck models features and output for its high accurecy and aaceptance HOT 1
- overfitting HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from hub.