NVIDIA / vid2vid

Pytorch implementation of our method for high-resolution (e.g. 2048x1024) photorealistic video-to-video translation.
Other
8.6k stars 1.2k forks source link

mportError: /vid2vid/models/flownet2_pytorch/networks/resample2d_package/_ext/resample2d/_resample2d.so: undefined symbol: PyInt_FromLong #6

Closed ding-hai closed 6 years ago

ding-hai commented 6 years ago

I run this command

python3 test.py --name label2city_2048 --loadSize 2048 --n_scales_spatial 3 --use_instance --fg --use_single_G

And got this error:

/usr/lib/python3.5/importlib/_bootstrap.py:222: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
  return f(*args, **kwds)
/usr/lib/python3.5/importlib/_bootstrap.py:222: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
  return f(*args, **kwds)
------------ Options -------------
aspect_ratio: 1.0
batchSize: 1
checkpoints_dir: ./checkpoints
dataroot: datasets/Cityscapes/
dataset_mode: temporal
debug: False
display_id: 0
display_winsize: 512
feat_num: 3
fg: True
fg_labels: [26]
fineSize: 512
gpu_ids: [0]
how_many: 300
input_nc: 3
isTrain: False
label_feat: False
label_nc: 35
loadSize: 2048
load_features: False
load_pretrain: 
max_dataset_size: inf
model: vid2vid
nThreads: 2
n_blocks: 9
n_blocks_local: 3
n_downsample_E: 3
n_downsample_G: 3
n_frames_G: 3
n_gpus_gen: 1
n_local_enhancers: 1
n_scales_spatial: 3
name: label2city_2048
ndf: 64
nef: 32
netE: simple
netG: composite
ngf: 128
no_first_img: False
no_flip: False
norm: batch
ntest: inf
output_nc: 3
phase: test
resize_or_crop: scaleWidth
results_dir: ./results/
serial_batches: False
tf_log: False
use_instance: True
use_real_img: False
use_single_G: True
which_epoch: latest
-------------- End ----------------
CustomDatasetDataLoader
dataset [TestDataset] was created
vid2vid
Traceback (most recent call last):
  File "test.py", line 24, in <module>
    model = create_model(opt)
  File "/vid2vid/models/models.py", line 19, in create_model
    modelG.initialize(opt)
  File "/vid2vid/models/vid2vid_model_G.py", line 37, in initialize
    opt.n_downsample_G, opt.norm, 0, self.gpu_ids, opt)
  File "/vid2vid/models/networks.py", line 42, in define_G
    netG = CompositeGenerator(input_nc, output_nc, prev_output_nc, ngf, n_downsampling, opt.n_blocks, opt.fg, norm_layer)
  File "/vid2vid/models/networks.py", line 83, in __init__
    from .flownet2_pytorch.networks.resample2d_package.modules.resample2d import Resample2d            
  File "/vid2vid/models/flownet2_pytorch/networks/resample2d_package/modules/resample2d.py", line 2, in <module>
    from ..functions.resample2d import Resample2dFunction
  File "/vid2vid/models/flownet2_pytorch/networks/resample2d_package/functions/resample2d.py", line 3, in <module>
    from .._ext import resample2d
  File "/vid2vid/models/flownet2_pytorch/networks/resample2d_package/_ext/resample2d/__init__.py", line 3, in <module>
    from ._resample2d import lib as _lib, ffi as _ffi
ImportError: /vid2vid/models/flownet2_pytorch/networks/resample2d_package/_ext/resample2d/_resample2d.so: undefined symbol: PyInt_FromLong

ImportError: /vid2vid/models/flownet2_pytorch/networks/resample2d_package/_ext/resample2d/_resample2d.so: undefined symbol: PyInt_FromLong

Why?How?

tcwang0509 commented 6 years ago

It looks like flownet2 wasn't compiled successfully. Please refer to https://github.com/NVIDIA/flownet2-pytorch/issues to see if there are similar issues.

ding-hai commented 6 years ago

I use the python36 branch of https://github.com/NVIDIA/flownet2-pytorch ,and the error was solved . But the new one is occurs below:

root@9b2241734e98:/vid2vid# python3  test.py --name label2city_2048 --loadSize 2048 --n_scales_spatial 3 --use_instance --fg --use_single_G
/usr/lib/python3.5/importlib/_bootstrap.py:222: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
  return f(*args, **kwds)
/usr/lib/python3.5/importlib/_bootstrap.py:222: RuntimeWarning: numpy.dtype size changed, may indicate binary incompatibility. Expected 96, got 88
  return f(*args, **kwds)
------------ Options -------------
aspect_ratio: 1.0
batchSize: 1
checkpoints_dir: ./checkpoints
dataroot: datasets/Cityscapes/
dataset_mode: temporal
debug: False
display_id: 0
display_winsize: 512
feat_num: 3
fg: True
fg_labels: [26]
fineSize: 512
gpu_ids: [0]
how_many: 300
input_nc: 3
isTrain: False
label_feat: False
label_nc: 35
loadSize: 2048
load_features: False
load_pretrain: 
max_dataset_size: inf
model: vid2vid
nThreads: 2
n_blocks: 9
n_blocks_local: 3
n_downsample_E: 3
n_downsample_G: 3
n_frames_G: 3
n_gpus_gen: 1
n_local_enhancers: 1
n_scales_spatial: 3
name: label2city_2048
ndf: 64
nef: 32
netE: simple
netG: composite
ngf: 128
no_first_img: False
no_flip: False
norm: batch
ntest: inf
output_nc: 3
phase: test
resize_or_crop: scaleWidth
results_dir: ./results/
serial_batches: False
tf_log: False
use_instance: True
use_real_img: False
use_single_G: True
which_epoch: latest
-------------- End ----------------
CustomDatasetDataLoader
dataset [TestDataset] was created
vid2vid
---------- Networks initialized -------------
-----------------------------------------------
Traceback (most recent call last):
  File "test.py", line 24, in <module>
    model = create_model(opt)
  File "/vid2vid/models/models.py", line 19, in create_model
    modelG.initialize(opt)
  File "/vid2vid/models/vid2vid_model_G.py", line 51, in initialize
    self.netG_i = self.load_single_G() if self.use_single_G else None
  File "/vid2vid/models/vid2vid_model_G.py", line 270, in load_single_G
    netG = networks.define_G(input_nc, opt.output_nc, 0, 32, 'local', 4, 'instance', 0, self.gpu_ids, opt)
  File "/vid2vid/models/networks.py", line 39, in define_G
    netG = LocalEnhancer(input_nc, output_nc, ngf, n_downsampling, opt.n_blocks, opt.n_local_enhancers, opt.n_blocks_local, norm_layer)
  File "/vid2vid/models/networks.py", line 320, in __init__
    model_global = GlobalGenerator(input_nc, output_nc, ngf_global, n_downsample_global, n_blocks_global, norm_layer).model        
  File "/vid2vid/models/networks.py", line 286, in __init__
    model = [nn.ReflectionPad2d(3), nn.Conv2d(input_nc, ngf, kernel_size=7, padding=0), norm_layer(ngf), activation]
TypeError: __init__() got an unexpected keyword argument 'track_running_stats'

TypeError: init() got an unexpected keyword argument 'track_running_stats'

tcwang0509 commented 6 years ago

This error should be solved by using pyTorch >= 0.4.