Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make resource 에서 오류 발생 #5

Closed
Adam-Kim opened this issue Dec 3, 2018 · 6 comments
Closed

make resource 에서 오류 발생 #5

Adam-Kim opened this issue Dec 3, 2018 · 6 comments
Milestone

Comments

@Adam-Kim
Copy link

Adam-Kim commented Dec 3, 2018

오류

 File "./bin/compile_model.py", line 40
    file_path = f'{rsc_src}/{model_size}.config.json'
                                                    ^
SyntaxError: invalid syntax

Makefile:37: '/home/storage/build/khaiii/build/share/khaiii/config.json' 타겟에 대한 명령이 실패했습니다
make[4]: *** [/home/storage/build/khaiii/build/share/khaiii/config.json] 오류 1
CMakeFiles/resource.dir/build.make:57: 'CMakeFiles/resource' 타겟에 대한 명령이 실패했습니다
make[3]: *** [CMakeFiles/resource] 오류 2
CMakeFiles/Makefile2:284: 'CMakeFiles/resource.dir/all' 타겟에 대한 명령이 실패했습니다
make[2]: *** [CMakeFiles/resource.dir/all] 오류 2
CMakeFiles/Makefile2:291: 'CMakeFiles/resource.dir/rule' 타겟에 대한 명령이 실패했습니다
make[1]: *** [CMakeFiles/resource.dir/rule] 오류 2
Makefile:275: 'resource' 타겟에 대한 명령이 실패했습니다
make: *** [resource] 오류 2

make all 까지 100% 진행이 다 되고
bin/khaiii 생성되고
build/khaiii/share/khaiii 폴더 밑에는 아무것도 없습니다.

파이썬 버전과 requirement에 버전은 전부 확인했는데 이상없었습니다.

환경은 linux, docker container 내부에서 git clone하여 실행시켰습니다.

@Ella77
Copy link

Ella77 commented Dec 3, 2018

I got similar error but with no syntax error

Traceback (most recent call last):
File "./bin/compile_model.py", line 23, in
import torch
ModuleNotFoundError: No module named 'torch'
Makefile:37: recipe for target '/home/khaiii/build/share/khaiii/config.json' failed
make[4]: * [/home/khaiii/build/share/khaiii/config.json] Error 1
CMakeFiles/resource.dir/build.make:57: recipe for target 'CMakeFiles/resource' failed
make[3]: * [CMakeFiles/resource] Error 2
CMakeFiles/Makefile2:279: recipe for target 'CMakeFiles/resource.dir/all' failed
make[2]: * [CMakeFiles/resource.dir/all] Error 2
CMakeFiles/Makefile2:286: recipe for target 'CMakeFiles/resource.dir/rule' failed
make[1]: * [CMakeFiles/resource.dir/rule] Error 2
Makefile:275: recipe for target 'resource' failed
make: * [resource] Error 2

@k2hyun
Copy link

k2hyun commented Dec 3, 2018

@Kimdoun f-string 포맷에서 invalid syntax 오류가 나오는 것을 보면 python 버전이 3.6 미만인 것 같습니다.

@k2hyun
Copy link

k2hyun commented Dec 3, 2018

@Ella77 You have to install pytorch by running pip install -r requirements.txt before make resource

@Ella77
Copy link

Ella77 commented Dec 4, 2018

@Ella77 You have to install pytorch by running pip install -r requirements.txt before make resource

I did but I didn't assure installments are done. (for someone experiencing same error)

Because there is my specific problem while installing.
Could not install packages due to an EnvironmentError: [Errno 13] Permission denied: '/usr/local/lib/python3.6/dist-packages/torch'
Consider using the --user option or check the permissions.

with --user option I could install
And after resource successfully made... Thanks :)

@likejazz
Copy link

likejazz commented Dec 4, 2018

@Ella77 Just use the provided docker file in /docker directory.

$ cd docker
$ docker build . -t khaiii
$ docker run -it khaiii /bin/bash
$ bin/khaiii --rsc-dir=share/khaiii/  # Inside a Docker

cc @Kimdoun

@cynthia
Copy link
Contributor

cynthia commented Dec 5, 2018

String literals in Python are a relatively new feature, and unless you have full control over the stack involved it seems like a rather risky thing to use - in particular it doesn't seem like a great fit for a open source library.

Considering that a significant chunk of the academic community is still stuck on Python 2, would be nice to fix.

This doesn't seem like a complex issue to fix, unless significant parts of the resource build pipeline has unicode-isms. (expecting str types to be unicode, rather than bytestring)

Is that the case?

cynthia added a commit to cynthia/khaiii that referenced this issue Dec 5, 2018
This fixes the Py3.6-isms, but will not fix cases where a string
is expected to be unicode. I haven't checked if that is the case,
but judging from the nature of the project the likelihood of a
follow-up patch to fix that seems pretty high.
cynthia added a commit to cynthia/khaiii that referenced this issue Dec 5, 2018
cynthia added a commit to cynthia/khaiii that referenced this issue Dec 5, 2018
krikit pushed a commit that referenced this issue Dec 6, 2018
This fixes the Py3.6-isms, but will not fix cases where a string
is expected to be unicode. I haven't checked if that is the case,
but judging from the nature of the project the likelihood of a
follow-up patch to fix that seems pretty high.
@krikit krikit added this to the 0.2 milestone Dec 6, 2018
@krikit krikit closed this as completed Dec 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants