본문 바로가기
반응형

Etc/Error4

[Error] TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first. TypeError: can't convert cuda:0 device type tensor to numpy. Use Tensor.cpu() to copy the tensor to host memory first. cuda를 사용하여 MNIST 데이터에 대한 간단한 두 모델을 비교하기 위해 두 가지 모델의 loss 값을 matplotlib 통해 시각화하는 과정에서 다음 오류가 발생했다. 해당 오류는 gpu에 할당되어 있는 텐서를 numpy 배열로 변환할 때 생기는 에러라고 한다. 그래서 저장된 loss 값을 확인해보니 다음과 같았다. 이렇게 저장되어있는 값을 바로 matplotlib을 통해 시각화를 진행하는 과정에서 자동으로 numpy값으로 변환하려다 보니 오류가 발생한 것 같다. 해당 오류는 gpu에 할.. 2023. 3. 16.
[Error] OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized. OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized. PyTorch가 설치되어 있는 가상환경에서 matplotlib 설치 후 활용하여 시각화를 하는 과정에서 다음과 같은 오류가 발생했다. 해결하기 위해 새로운 가상환경을 만들어서 시도해봤지만 똑같은 오류가 발생했다. OMP: Error #15: Initializing libiomp5md.dll, but found libiomp5md.dll already initialized. OMP: Hint This means that multiple copies of the OpenMP runtime have been linked into the program.. 2023. 3. 16.
[Error] AttributeError: 'GradientBoostingClassifier' object has no attribute '_loss' AttributeError: 'GradientBoostingClassifier' object has no attribute '_loss' Flask를 통해 Web 배포를 하는 도중 다음과 같은 오류가 발생했다. 2023-01-27 07:24:56,974: Exception on /predict [POST] Traceback (most recent call last): File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 2077, in wsgi_app response = self.full_dispatch_request() File "/usr/local/lib/python3.10/site-packages/flask/app.py", line 1.. 2023. 1. 30.
[Error] jinja2.exceptions.TemplateNotFound: jinja2.exceptions.TemplateNotFound: Flask 공식문서의 Quickstart - Rendering Templates를 보게 되면 다음과 같은 설명이 있다. 결론부터 말하자면 templates 폴더를 생성해 안에 적용하고 싶은 template을 넣으면 된다. Generating HTML from within Python is not fun, and actually pretty cumbersome because you have to do the HTML escaping on your own to keep the application secure. Because of that Flask configures the Jinja2 template engine for you automat.. 2023. 1. 7.
반응형