도전 deep3d 실패 이야기
6317 단어 DeepLearningPython
입문
본 보도는 Python Advent Calendar 2016의 3일째 보도입니다.
실패한 이야기여서 결국 잘못으로 끝났다.
무엇이 deep3d입니까
DeepLearning을 사용하여 이미지를 3D 이미지로 변환합니다프로그램 라이브러리.
이것이 바로
이렇게 될 거야!
꿈이 커지고 있어요.
여기서부터 간단한 순서 설명.
GPU용 기기 준비
DeepLearning을 사용하여 이미지를 3D 이미지로 변환합니다프로그램 라이브러리.
이것이 바로
이렇게 될 거야!
꿈이 커지고 있어요.
여기서부터 간단한 순서 설명.
GPU용 기기 준비
꿈이 커지고 있어요.
여기서부터 간단한 순서 설명.
GPU용 기기 준비
GPU용 기기 준비
설치 라이브러리
참고 자료
Setup Amazon AWS GPU instance with MXnet
g2.2xlarge
nvidia-smi
에 표시되는 GPU는 1개Deep3D 지원 MXNet 0.7.0 설치
준비python
이미지 준비
예시와 같은 방식으로 실행하다
예시와 같은 방식으로 실행하다 import mxnet as mx
import numpy as np
import os
import urllib
import cv2
from PIL import Image
from images2gif import writeGif
import logging
logging.basicConfig(level=logging.DEBUG)
예시와 같은 방식으로 실행하다 if not os.path.exists('deep3d-0050.params'):
urllib.urlretrieve('http://homes.cs.washington.edu/~jxie/download/deep3d-0050.params', 'deep3d-0050.params')
model = mx.model.FeedForward.load('deep3d', 50, mx.gpu(0))
shape = (384, 160)
img = cv2.imread('demo.jpg')
raw_shape = (img.shape[1], img.shape[0])
img = cv2.resize(img, shape)
X = img.astype(np.float32).transpose((2,0,1))
X = X.reshape((1,)+X.shape)
test_iter = mx.io.NDArrayIter({'left': X, 'left0':X})
Y = model.predict(test_iter)
FATAL ERROR!!!! >>> test_iter = mx.io.NDArrayIter({'left': X, 'left0':X})
>>> Y = model.predict(test_iter)
[16:21:56] src/operator/./reshape-inl.h:311: Using target_shape will be deprecated.
[16:21:57] src/operator/./reshape-inl.h:311: Using target_shape will be deprecated.
[16:21:57] src/operator/./reshape-inl.h:311: Using target_shape will be deprecated.
[16:21:57] /home/ubuntu/mxnet/dmlc-core/include/dmlc/logging.h:235: [16:21:57] src/operator/./cudnn_softmax_activation-inl.h:44: Check failed: (in_data[softmax_activation::kData].ndim()) == (2) Input need to have 2 dimensions when mode=instance.
[16:21:57] /home/ubuntu/mxnet/dmlc-core/include/dmlc/logging.h:235: [16:21:57] src/engine/./threaded_engine.h:306: [16:21:57] src/operator/./cudnn_softmax_activation-inl.h:44: Check failed: (in_data[softmax_activation::kData].ndim()) == (2) Input need to have 2 dimensions when mode=instance.
An fatal error occurred in asynchronous engine operation. If you do not know what caused this error, you can try set environment variable MXNET_ENGINE_TYPE to NaiveEngine and run with debugger (i.e. gdb). This will force all operations to be synchronous and backtrace will give you the series of calls that lead to this error. Remember to set MXNET_ENGINE_TYPE back to empty after debugging.
terminate called after throwing an instance of 'dmlc::Error'
what(): [16:21:57] src/engine/./threaded_engine.h:306: [16:21:57] src/operator/./cudnn_softmax_activation-inl.h:44: Check failed: (in_data[softmax_activation::kData].ndim()) == (2) Input need to have 2 dimensions when mode=instance.
An fatal error occurred in asynchronous engine operation. If you do not know what caused this error, you can try set environment variable MXNET_ENGINE_TYPE to NaiveEngine and run with debugger (i.e. gdb). This will force all operations to be synchronous and backtrace will give you the series of calls that lead to this error. Remember to set MXNET_ENGINE_TYPE back to empty after debugging.
Aborted (core dumped)
why?
import mxnet as mx
import numpy as np
import os
import urllib
import cv2
from PIL import Image
from images2gif import writeGif
import logging
logging.basicConfig(level=logging.DEBUG)
if not os.path.exists('deep3d-0050.params'):
urllib.urlretrieve('http://homes.cs.washington.edu/~jxie/download/deep3d-0050.params', 'deep3d-0050.params')
model = mx.model.FeedForward.load('deep3d', 50, mx.gpu(0))
shape = (384, 160)
img = cv2.imread('demo.jpg')
raw_shape = (img.shape[1], img.shape[0])
img = cv2.resize(img, shape)
X = img.astype(np.float32).transpose((2,0,1))
X = X.reshape((1,)+X.shape)
test_iter = mx.io.NDArrayIter({'left': X, 'left0':X})
Y = model.predict(test_iter)
FATAL ERROR!!!! >>> test_iter = mx.io.NDArrayIter({'left': X, 'left0':X})
>>> Y = model.predict(test_iter)
[16:21:56] src/operator/./reshape-inl.h:311: Using target_shape will be deprecated.
[16:21:57] src/operator/./reshape-inl.h:311: Using target_shape will be deprecated.
[16:21:57] src/operator/./reshape-inl.h:311: Using target_shape will be deprecated.
[16:21:57] /home/ubuntu/mxnet/dmlc-core/include/dmlc/logging.h:235: [16:21:57] src/operator/./cudnn_softmax_activation-inl.h:44: Check failed: (in_data[softmax_activation::kData].ndim()) == (2) Input need to have 2 dimensions when mode=instance.
[16:21:57] /home/ubuntu/mxnet/dmlc-core/include/dmlc/logging.h:235: [16:21:57] src/engine/./threaded_engine.h:306: [16:21:57] src/operator/./cudnn_softmax_activation-inl.h:44: Check failed: (in_data[softmax_activation::kData].ndim()) == (2) Input need to have 2 dimensions when mode=instance.
An fatal error occurred in asynchronous engine operation. If you do not know what caused this error, you can try set environment variable MXNET_ENGINE_TYPE to NaiveEngine and run with debugger (i.e. gdb). This will force all operations to be synchronous and backtrace will give you the series of calls that lead to this error. Remember to set MXNET_ENGINE_TYPE back to empty after debugging.
terminate called after throwing an instance of 'dmlc::Error'
what(): [16:21:57] src/engine/./threaded_engine.h:306: [16:21:57] src/operator/./cudnn_softmax_activation-inl.h:44: Check failed: (in_data[softmax_activation::kData].ndim()) == (2) Input need to have 2 dimensions when mode=instance.
An fatal error occurred in asynchronous engine operation. If you do not know what caused this error, you can try set environment variable MXNET_ENGINE_TYPE to NaiveEngine and run with debugger (i.e. gdb). This will force all operations to be synchronous and backtrace will give you the series of calls that lead to this error. Remember to set MXNET_ENGINE_TYPE back to empty after debugging.
Aborted (core dumped)
why?
>>> test_iter = mx.io.NDArrayIter({'left': X, 'left0':X})
>>> Y = model.predict(test_iter)
[16:21:56] src/operator/./reshape-inl.h:311: Using target_shape will be deprecated.
[16:21:57] src/operator/./reshape-inl.h:311: Using target_shape will be deprecated.
[16:21:57] src/operator/./reshape-inl.h:311: Using target_shape will be deprecated.
[16:21:57] /home/ubuntu/mxnet/dmlc-core/include/dmlc/logging.h:235: [16:21:57] src/operator/./cudnn_softmax_activation-inl.h:44: Check failed: (in_data[softmax_activation::kData].ndim()) == (2) Input need to have 2 dimensions when mode=instance.
[16:21:57] /home/ubuntu/mxnet/dmlc-core/include/dmlc/logging.h:235: [16:21:57] src/engine/./threaded_engine.h:306: [16:21:57] src/operator/./cudnn_softmax_activation-inl.h:44: Check failed: (in_data[softmax_activation::kData].ndim()) == (2) Input need to have 2 dimensions when mode=instance.
An fatal error occurred in asynchronous engine operation. If you do not know what caused this error, you can try set environment variable MXNET_ENGINE_TYPE to NaiveEngine and run with debugger (i.e. gdb). This will force all operations to be synchronous and backtrace will give you the series of calls that lead to this error. Remember to set MXNET_ENGINE_TYPE back to empty after debugging.
terminate called after throwing an instance of 'dmlc::Error'
what(): [16:21:57] src/engine/./threaded_engine.h:306: [16:21:57] src/operator/./cudnn_softmax_activation-inl.h:44: Check failed: (in_data[softmax_activation::kData].ndim()) == (2) Input need to have 2 dimensions when mode=instance.
An fatal error occurred in asynchronous engine operation. If you do not know what caused this error, you can try set environment variable MXNET_ENGINE_TYPE to NaiveEngine and run with debugger (i.e. gdb). This will force all operations to be synchronous and backtrace will give you the series of calls that lead to this error. Remember to set MXNET_ENGINE_TYPE back to empty after debugging.
Aborted (core dumped)
Input need to have 2 dimensions when mode=instance.
test_iter = mx.io.NDArrayIter({'left': X, 'left0':X})
(´·ω·`)
끝내다
Reference
이 문제에 관하여(도전 deep3d 실패 이야기), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/ukisoft/items/ab5a786939391a442cf5텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)