Local machine, 그리고 서버에서 잘 동작하는지 확인하고 온건데... 막상 이 모델을 실행시켜야하는 docker container 안에 들어오니 어떤 환경이 달라서인지 다음과 같은 에러가 떴다. 실행코드 #include #include int main(int args, char **argv){ std::string modelfile = argv[1]; torch::jit::scriptModule model_; model_ = torch::jit::load(modelfile); return 0; } 에러 메시지 terminate called after throwing an instance of 'torch::jit::ErrorReport' what(): Unknown type name 'NoneT..
torchscript로 model을 저장하기 위해... numpy 연산을 없애야만 했다. onnx 및 torch::jit::scriptModule로 변환을 하는 데 있어서 trace-based exporter가 numpy value를 잘 trace할 수 없다고 한다. PyTorch models can be written using numpy manipulations, but this is not proper when we convert to the ONNX model. For the trace-based exporter, tracing treats the numpy values as the constant node, therefore it calculates the wrong result if we ch..
Error AttributeError: module 'torch' has no attribute 'argsort' 원인 1. pytorch 1.0 이상의 version을 사용하지 않아서. pytorch 0.4.1 같은 1.0 미만의 version에는 argsort 함수가 구현되어 있지 않다. Solution 1. pytorch upgrade python3 -m pip install torch==1.0 이렇게 version을 직접 정해주거나 아니면 그냥 torch만 입력하면 가장 최신 version으로 install해준다. uninstall torch==0.4.1을 하고 하면 더 좋겠지만 안그래도 큰 문제는 없음. 2. 직접 argsort 구현 or np.argsort 로 대체하기. 이 경우는 pytorc..
- Total
- Today
- Yesterday
- LGSVL
- dfs
- 프로그래머스
- Python
- 파이썬
- numpy
- 카카오
- 설치
- version
- 백준
- 최소신장트리
- PIP
- torchscript
- shellscript
- n과m
- tensorflow
- torch
- notfound
- 백트래킹
- error
- 동적프로그래밍
- docker
- CUDA
- pytorch
- 코딩테스트
- 설치하기
- 이것이코딩테스트다
- 다익스트라
- BFS
- matplotlib
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |