Open chuanwise opened 10 months ago
Hi, that is strange, I've just tried to do the same and got the following error:
Collecting package metadata (repodata.json): done
Solving environment: failed
ResolvePackageNotFound:
- pytorch==2.2.0.dev20231001=py3.11_cuda12.1_cudnn8.9.2_0
- torchvision==0.17.0.dev20231001=py311_cu121
- torchaudio==2.2.0.dev20231001=py311_cu121
Which should be solved by installing pytorch manually:
conda install pytorch torchvision torchaudio pytorch-cuda=11.8 -c pytorch-nightly -c nvidia
At least click==8.0.4=py311h06a4308_0
resolves successfully:
> conda install click=8.0.4=py311h06a4308_0
Collecting package metadata (current_repodata.json): done
Solving environment: done
==> WARNING: A newer version of conda exists. <==
current version: 22.11.1
latest version: 23.9.0
Please update conda by running
$ conda update -n base -c defaults conda
Or to minimize the number of packages updated during conda update use
conda install conda=23.9.0
## Package Plan ##
environment location: /home/zeio/anaconda3/envs/foo
added / updated specs:
- click==8.0.4=py311h06a4308_0
The following NEW packages will be INSTALLED:
click pkgs/main/linux-64::click-8.0.4-py311h06a4308_0
Python version is specified in the environment config
What version of conda
do you use? Do you run the package on windows
or linux
?
I used anaconda 23.9.0
on Windows
, and my chanels related settings in .condarc
is:
channels:
- defaults
- conda-forge
default_channels:
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/main
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/r
- https://mirrors.tuna.tsinghua.edu.cn/anaconda/pkgs/msys2
custom_channels:
conda-forge: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
msys2: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
bioconda: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
menpo: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
pytorch: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
pytorch-lts: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
simpleitk: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud
deepmodeling: https://mirrors.tuna.tsinghua.edu.cn/anaconda/cloud/
I tried to change my .condarc
to:
channels:
- defaults
- conda-forge
But it doesn't work : (
Did you use some special mirrors or channels in defaults
?
No, there are no special settings in my .condarc
related to channels. If you are using windows
then maybe that's why default environment.yml
doesn't work for you, because I've generated it from linux
.
In this case I would try to install the dependencies one-by-one manually starting from pytorch
and openai
, there aren't actually a lot of them - the list in environment.yml
mostly consists of 'secondary' dependencies, which will be installed automatically
I created environment in my wsl
successfully. Then I run command python -m spike ask 'What kind of bear is best
and it printed:
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/home/chuanwise/develop/projects/spike/spike/__main__.py", line 376, in <module>
main()
File "/home/chuanwise/anaconda3/lib/python3.11/site-packages/click/core.py", line 1128, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/chuanwise/anaconda3/lib/python3.11/site-packages/click/core.py", line 1053, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/home/chuanwise/anaconda3/lib/python3.11/site-packages/click/core.py", line 1659, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/chuanwise/anaconda3/lib/python3.11/site-packages/click/core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/chuanwise/anaconda3/lib/python3.11/site-packages/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/chuanwise/develop/projects/spike/spike/__main__.py", line 73, in ask
answer = responder.ask(question, fresh = fresh, dry_run = dry_run)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/chuanwise/develop/projects/spike/spike/Responder.py", line 92, in ask
context = OrkgContext(fresh = fresh, graph = self.graph)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/chuanwise/develop/projects/spike/spike/OrkgContext.py", line 80, in __init__
with open(cache_path, 'wb') as file:
^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: 'assets/cache/orkg-context.pkl'
I downloaded orkg.pkl
and placed it to asserts
and I tried to copy one and rename it to cache/orkg-context.pkl
, then it printed:
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/home/chuanwise/develop/projects/spike/spike/__main__.py", line 376, in <module>
main()
File "/home/chuanwise/anaconda3/lib/python3.11/site-packages/click/core.py", line 1128, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/chuanwise/anaconda3/lib/python3.11/site-packages/click/core.py", line 1053, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/home/chuanwise/anaconda3/lib/python3.11/site-packages/click/core.py", line 1659, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/chuanwise/anaconda3/lib/python3.11/site-packages/click/core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/chuanwise/anaconda3/lib/python3.11/site-packages/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/chuanwise/develop/projects/spike/spike/__main__.py", line 73, in ask
answer = responder.ask(question, fresh = fresh, dry_run = dry_run)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/chuanwise/develop/projects/spike/spike/Responder.py", line 101, in ask
examples, _ = context.cut(question)
^^^^^^^^^^^^^^^^^^^^^
File "/home/chuanwise/develop/projects/spike/spike/OrkgContext.py", line 86, in cut
return examples, '\n'.join([
^
File "/home/chuanwise/develop/projects/spike/spike/OrkgContext.py", line 91, in <listcomp>
entry.mark == PrefixContextEntry.mark or
^^^^^^^^^^
AttributeError: 'tuple' object has no attribute 'mark'
I can run run.sh
. But it does not always run successfully. Sometimes It will raise exception:
000. What are the titles and IDs of research papers that include a benchmark for the HoC dataset?
Traceback (most recent call last):
File "<frozen runpy>", line 198, in _run_module_as_main
File "<frozen runpy>", line 88, in _run_code
File "/home/chuanwise/develop/projects/spike/spike/__main__.py", line 378, in <module>
main()
File "/home/chuanwise/anaconda3/lib/python3.11/site-packages/click/core.py", line 1128, in __call__
return self.main(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/chuanwise/anaconda3/lib/python3.11/site-packages/click/core.py", line 1053, in main
rv = self.invoke(ctx)
^^^^^^^^^^^^^^^^
File "/home/chuanwise/anaconda3/lib/python3.11/site-packages/click/core.py", line 1659, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/chuanwise/anaconda3/lib/python3.11/site-packages/click/core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/chuanwise/anaconda3/lib/python3.11/site-packages/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/chuanwise/develop/projects/spike/spike/__main__.py", line 100, in ask
query, answer = responder.ask(question)
^^^^^^^^^^^^^^^^^^^^^^^
File "/home/chuanwise/develop/projects/spike/spike/Responder.py", line 92, in ask
context = OrkgContext(fresh = fresh, graph = self.graph)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/chuanwise/develop/projects/spike/spike/OrkgContext.py", line 73, in __init__
context.append(ClassContextEntry.from_binding(binding, prefixes = PREFIXES))
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/chuanwise/develop/projects/spike/spike/ClassContextEntry.py", line 18, in from_binding
prefix, name = cut_prefix(binding['class']['value'], prefixes)
~~~~~~~^^^^^^^^^
TypeError: string indices must be integers, not 'str'
I changed codes near OrkgContext.py
(81) from:
with open(cache_path, 'wb') as file:
pkl.dump(context, file)
to:
if os.path.isfile(cache_path):
with open(cache_path, 'wb') as file:
pkl.dump(context, file)
Then the program runs. Should this code look like this?
I found that this program treats problems as if they were problems in ORKG.
I wanted to port it to other knowledge graphs, so I tried to add the option - g graph-serialized-by- rdflib
, but found that the content under the ORKG namespace still appeared in the generated query.
How to transplant it to other knowledge graphs provided by rdflib.Graph
?
I can not use
conda env create -f ./environment.yml
to create provided environment. I met:or:
I retried many many many many time but it still fail : (