anishathalye / neural-style

Neural style in TensorFlow! 🎨
https://anishathalye.com/an-ai-that-can-mimic-any-artist/
GNU General Public License v3.0
5.54k stars 1.51k forks source link

smaller Pre-trained VGG network option ? #117

Closed ttpro1995 closed 6 years ago

ttpro1995 commented 6 years ago

I have 1050 Ti with 4 GB. However it is too small to fit anything in. Can I have an option to use smaller pretrain VGG network ? If so, please give me detail.

ttpro1995 commented 6 years ago

Error I got

python neural_style.py --styles data/cat.jpg --output output/ --content data/dan-min.jpg --checkpoint-output checkpoint%s.jpg --checkpoint-iterations 100 --network imagenet-vgg-verydeep-19.mat 
/home/thaithien/miniconda3/envs/py3cudatf/lib/python3.6/site-packages/h5py/__init__.py:36: FutureWarning: Conversion of the second argument of issubdtype from `float` to `np.floating` is deprecated. In future, it will be treated as `np.float64 == np.dtype(float).type`.
  from ._conv import register_converters as _register_converters
2018-03-20 02:12:32.198438: I tensorflow/stream_executor/cuda/cuda_gpu_executor.cc:898] successful NUMA node read from SysFS had negative value (-1), but there must be at least one NUMA node, so returning NUMA node zero
2018-03-20 02:12:32.198820: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1212] Found device 0 with properties: 
name: GeForce GTX 1050 Ti major: 6 minor: 1 memoryClockRate(GHz): 1.455
pciBusID: 0000:01:00.0
totalMemory: 3.94GiB freeMemory: 3.59GiB
2018-03-20 02:12:32.198847: I tensorflow/core/common_runtime/gpu/gpu_device.cc:1312] Adding visible gpu devices: 0
2018-03-20 02:12:32.439718: I tensorflow/core/common_runtime/gpu/gpu_device.cc:993] Creating TensorFlow device (/job:localhost/replica:0/task:0/device:GPU:0 with 3327 MB memory) -> physical GPU (device: 0, name: GeForce GTX 1050 Ti, pci bus id: 0000:01:00.0, compute capability: 6.1)
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
[1]    4976 abort (core dumped)  python neural_style.py --styles data/cat.jpg --output output/ --content 
anishathalye commented 6 years ago

VGG is a standard network, so I don't know what it would mean to use a smaller VGG network. If you don't have enough GPU memory, get a bigger GPU, rent one on the cloud, or use CPU.