Comments (6)
I got the same issue!
comment out spacy
in requirements.txt file, then run the command pip install -e .
After that conda install spacy
You might get an error with opencv, in that case
pip uninstall opencv-contrib-python
pip uninstall opencv-python
pip uninstall opencv-python-headless
pip install opencv-python====4.6.0.66
After all, run python src/main.py --init
from doc2graph.
Sorry for the late answer @0000F8 and thank you @VimukthiRandika1997 for the solution!
I will try again in local, solve the conflicts and push the changes! Leaving the issue open for now, closing with next commit!
from doc2graph.
@andreagemelli Thank you very much!
from doc2graph.
Still get
Traceback (most recent call last):
File "/Users/z1ggy/projects/forma/doc2graph/src/main.py", line 4, in
from src.inference import inference
File "/Users/z1ggy/projects/forma/doc2graph/src/inference.py", line 7, in
from src.data.feature_builder import FeatureBuilder
File "/Users/z1ggy/projects/forma/doc2graph/src/data/feature_builder.py", line 3, in
import spacy
File "/Users/z1ggy/anaconda3/envs/doc2graph/lib/python3.9/site-packages/spacy/init.py", line 13, in
from . import pipeline # noqa: F401
File "/Users/z1ggy/anaconda3/envs/doc2graph/lib/python3.9/site-packages/spacy/pipeline/init.py", line 1, in
from .attributeruler import AttributeRuler
File "/Users/z1ggy/anaconda3/envs/doc2graph/lib/python3.9/site-packages/spacy/pipeline/attributeruler.py", line 8, in
from ..language import Language
File "/Users/z1ggy/anaconda3/envs/doc2graph/lib/python3.9/site-packages/spacy/language.py", line 43, in
from .pipe_analysis import analyze_pipes, print_pipe_analysis, validate_attrs
File "/Users/z1ggy/anaconda3/envs/doc2graph/lib/python3.9/site-packages/spacy/pipe_analysis.py", line 6, in
from .tokens import Doc, Span, Token
File "/Users/z1ggy/anaconda3/envs/doc2graph/lib/python3.9/site-packages/spacy/tokens/init.py", line 1, in
from ._serialize import DocBin
File "/Users/z1ggy/anaconda3/envs/doc2graph/lib/python3.9/site-packages/spacy/tokens/_serialize.py", line 14, in
from ..vocab import Vocab
File "spacy/vocab.pyx", line 1, in init spacy.vocab
File "spacy/tokens/doc.pyx", line 49, in init spacy.tokens.doc
File "/Users/z1ggy/anaconda3/envs/doc2graph/lib/python3.9/site-packages/spacy/schemas.py", line 287, in
class TokenPattern(BaseModel):
File "/Users/z1ggy/anaconda3/envs/doc2graph/lib/python3.9/site-packages/pydantic/main.py", line 299, in new
fields[ann_name] = ModelField.infer(
File "/Users/z1ggy/anaconda3/envs/doc2graph/lib/python3.9/site-packages/pydantic/fields.py", line 411, in infer
return cls(
File "/Users/z1ggy/anaconda3/envs/doc2graph/lib/python3.9/site-packages/pydantic/fields.py", line 342, in init
self.prepare()
File "/Users/z1ggy/anaconda3/envs/doc2graph/lib/python3.9/site-packages/pydantic/fields.py", line 451, in prepare
self._type_analysis()
File "/Users/z1ggy/anaconda3/envs/doc2graph/lib/python3.9/site-packages/pydantic/fields.py", line 545, in _type_analysis
self._type_analysis()
File "/Users/z1ggy/anaconda3/envs/doc2graph/lib/python3.9/site-packages/pydantic/fields.py", line 550, in _type_analysis
if issubclass(origin, Tuple): # type: ignore
File "/Users/z1ggy/anaconda3/envs/doc2graph/lib/python3.9/typing.py", line 852, in subclasscheck
return issubclass(cls, self.origin)
TypeError: issubclass() arg 1 must be a class
from doc2graph.
Sorry for the late answer @0000F8 and thank you @VimukthiRandika1997 for the solution! I will try again in local, solve the conflicts and push the changes! Leaving the issue open for now, closing with next commit!
Any chance of a timeline?
from doc2graph.
Tried this:
conda install -c conda-forge spacy
conda install -c conda-forge pydantic
ended up here:
/Users/z1ggy/anaconda3/envs/doc2graph/lib/python3.9/site-packages/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension: dlopen(/Users/z1ggy/anaconda3/envs/doc2graph/lib/python3.9/site-packages/torchvision/image.so, 0x0006): Symbol not found: (__ZN3c106detail19maybe_wrap_dim_slowExxb)
Referenced from: '/Users/z1ggy/anaconda3/envs/doc2graph/lib/python3.9/site-packages/torchvision/image.so'
Expected in: '/Users/z1ggy/anaconda3/envs/doc2graph/lib/python3.9/site-packages/torch/lib/libc10.dylib'
warn(f"Failed to load image Python extension: {e}")
DGL backend not selected or invalid. Assuming PyTorch for now.
Setting the default backend to "pytorch". You can change it in the ~/.dgl/config.json file or export the DGLBACKEND environment variable. Valid options are: pytorch, mxnet, tensorflow (all lowercase)
Traceback (most recent call last):
File "/Users/z1ggy/projects/forma/doc2graph/src/main.py", line 4, in
from src.inference import inference
File "/Users/z1ggy/projects/forma/doc2graph/src/inference.py", line 8, in
from src.data.graph_builder import GraphBuilder
File "/Users/z1ggy/projects/forma/doc2graph/src/data/graph_builder.py", line 6, in
import dgl
File "/Users/z1ggy/anaconda3/envs/doc2graph/lib/python3.9/site-packages/dgl/init.py", line 14, in
from .backend import backend_name, load_backend # usort: skip
File "/Users/z1ggy/anaconda3/envs/doc2graph/lib/python3.9/site-packages/dgl/backend/init.py", line 122, in
load_backend(get_preferred_backend())
File "/Users/z1ggy/anaconda3/envs/doc2graph/lib/python3.9/site-packages/dgl/backend/init.py", line 57, in load_backend
mod = importlib.import_module(".%s" % mod_name, name)
File "/Users/z1ggy/anaconda3/envs/doc2graph/lib/python3.9/importlib/init.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/Users/z1ggy/anaconda3/envs/doc2graph/lib/python3.9/site-packages/dgl/backend/pytorch/init.py", line 2, in
from .tensor import *
File "/Users/z1ggy/anaconda3/envs/doc2graph/lib/python3.9/site-packages/dgl/backend/pytorch/tensor.py", line 16, in
raise RuntimeError("DGL requires PyTorch >= 1.13.0")
RuntimeError: DGL requires PyTorch >= 1.13.0
Performed conda install pytorch
finally got to here:
(doc2graph) ➜ doc2graph git:(master) ✗ python src/main.py --init
/Users/z1ggy/anaconda3/envs/doc2graph/lib/python3.9/site-packages/torchvision/io/image.py:13: UserWarning: Failed to load image Python extension: dlopen(/Users/z1ggy/anaconda3/envs/doc2graph/lib/python3.9/site-packages/torchvision/image.so, 0x0006): Symbol not found: (__ZN2at4_ops19empty_memory_format4callEN3c108ArrayRefIxEENS2_8optionalINS2_10ScalarTypeEEENS5_INS2_6LayoutEEENS5_INS2_6DeviceEEENS5_IbEENS5_INS2_12MemoryFormatEEE)
Referenced from: '/Users/z1ggy/anaconda3/envs/doc2graph/lib/python3.9/site-packages/torchvision/image.so'
Expected in: '/Users/z1ggy/anaconda3/envs/doc2graph/lib/python3.9/site-packages/torch/lib/libtorch_cpu.dylib'
warn(f"Failed to load image Python extension: {e}")
Namespace(init=True, add_geom=False, add_embs=False, add_hist=False, add_visual=False, add_eweights=False, src_data='FUNSD', data_type='img', edge_type='fully', node_granularity='gt', num_polar_bins=8, model='e2e', gpu=-1, test=False, weights=None, inference=False, docs=None)
Downloading FUNSD
100% [..............................................................................] 36590 / 36590Downloading PAU
100% [................................................................................] 7264 / 7264Initialization completed!
from doc2graph.
Related Issues (19)
- FUNSD test result is very low! HOT 7
- Passing linking for test images . HOT 1
- Environment installation problem HOT 3
- e2e-funsd-best.pt Error(s) in loading state_dict HOT 3
- RuntimeError: CUDA out of memory HOT 1
- How to set tg batch_size HOT 3
- OSError: [E050] Can't find model 'en_core_web_lg'.
- RuntimeError: weight tensor should be defined either for all 4 classes or no classes but got weight tensor of shape: [3] HOT 4
- Anyone successfully had this run on M1 Mac CPU?
- Facing some Issue when i try to run main.py HOT 2
- How to train my data ?
- RunTime error: float division by zero in main.py HOT 5
- python src/main.py giving KeyError: 'feat' HOT 4
- dont know where the output /prediciton is saved.. HOT 1
- what does this actually tell by this prediciton .? HOT 2
- I have a prediciton for 50 images..but how do i map prediction to each and every result HOT 4
- get RuntimeError: Error(s) in loading state_dict for E2E: when doing test on model from training HOT 2
- Training on DocVQA? HOT 3
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 doc2graph.