Closed rinkstiekema closed 5 years ago
Hi
Have you added the python
directory to $PYTHONPATH
?
Either that or add .
to $PYTHONPATH
and then run from inside of python
.
Let me know if it doesn't work.
I have tried adding PYTHONPATH
and $PYTHONPATH
, with the path to the python folder of your project, to the environment variables (both local user and system). Then restarted my command prompt and retried. It still gives me:
python: can't open file 'bin/iterate/table_adjacency_parsing': [Errno 2] No such file or directory
Sorry I missed the WIndows part. I have set it up on Ubuntu it works there. For windows, you'll have to resolve all the dependencies; it may be hard so I recommend you to do it on Linux or more preferably Ubuntu.
But the above two errors are not because of that. The first error is because you are running the command from the python
folder. So there is no more python
folder inside of it. So you have to remove python
as you did.
Now it cannot recognize the module iterators
but a simple cd
will show that it is present. Hence, I am suspecting there could be some other issue. My first guess would be the python
version because they changed the structures etc in 3.5+
. Is it possible that you are running python 2.7
?
Whether I am running python bin/iterate/table_adjacency_parsing
from the root directory, or the python directory, does not matter. Both give python: can't open file 'bin/iterate/table_adjacency_parsing': [Errno 2] No such file or directory
When I instead use the full path to the table_adjacency_parsing.py
file (and include the .py
extension), it complains about the 'iterators' module. Since i'm using Python 3.7.3, this surprises me as the file indeed exists. My IDE also knows where to locate it. Any ideas?
I can try on a linux machine, but would prefer running it on windows as well.
Well, for now, I don't think windows is the issue.
Can you check which directory are you in when you run the above command using pwd
command? You have to be inside the python
directory when you issue the above command.
And which IDE are you using? I can probably help you if you are using PyCharm.
Am inside TIES-2.0/python/
. What I do not understand is why the command does not include the .py
extension, can you elaborate why this is? Am using Visual Studio Code for editing, but run from command line.
You are right. It should include .py
extension. My bad.
Since python will only look inside the current directory (I assume that is why you want to add the path to the PYTHONPATH
, although I'm not really sure how to do so), it won't find the files inside the iterators folder. I added the following lines to make it work:
import os
import sys
dir_path = os.path.dirname(os.path.realpath(__file__))
sys.path.insert(0, os.path.join(dir_path, '..', '..'))
Also want to make you aware that the package tensorflow-gpu==1.12.0
is invalid.
Collecting tensorflow-gpu==1.12.0 (from -r requirements.txt (line 1))
Could not find a version that satisfies the requirement tensorflow-gpu==1.12.0 (from -r requirements.txt (line 1)) (from versions: 1.13.0rc1, 1.13.0rc2, 1.13.1, 1.14.0rc0, 1.14.0rc1, 2.0.0a0, 2.0.0b0, 2.0.0b1)
No matching distribution found for tensorflow-gpu==1.12.0 (from -r requirements.txt (line 1))
I am not sure about your path hack. If it works, fine.
I tried installing the tensorflow-gpu==1.12.0
. It is working on my Ubuntu machine however fails to work on MacOS. So I am assuming that has something to do with windows. Consult tensorflow website to see the correct way to install tensorflow-gpu on Windows. If you couldn't get tensorflow-gpu==1.12.0
to work, you can also use tensorflow-gpu==1.13
.
@rinkstiekema were you able to run the program successfully?
@rinkstiekema were you able to run the program successfully?
I do not remember but as I closed the issue I do assume so.
@rinkstiekema I was able to train the model and accuracy was good. I'm struck in implementing maximal clique to get the output as table. If you have solved this problem, can you help?
When I try to run the program on windows, I get the error:
python: can't open file 'python/bin/iterate/table_adjacency_parsing': [Errno 2] No such file or directory
When changing the command to
python bin/iterate/table_adjacency_parsing.py
, I get the traceback: