svip-lab / impersonator

PyTorch implementation of our ICCV 2019 paper: Liquid Warping GAN: A Unified Framework for Human Motion Imitation, Appearance Transfer and Novel View Synthesis
https://svip-lab.github.io/project/impersonator
Other
1.72k stars 317 forks source link

How do I run train.py? #32

Open Tayfur26 opened 4 years ago

Tayfur26 commented 4 years ago

I want to train my data set. But I couldn't run the train.py file . I don't know how to proceed . Can you help me please ?

haviduck commented 4 years ago

Check out the params here https://github.com/svip-lab/impersonator/blob/master/options/train_options.py

Tayfur26 commented 4 years ago

When I enter the arguments, it asks me for the 'pose.pkl' and 'train.txt' files. When I define them as empty and add them to the dataset:


[TerminalIPythonApp] WARNING | GUI event loop or pylab initialization failed

UnknownBackendTraceback (most recent call last) /usr/local/lib/python3.6/dist-packages/IPython/core/interactiveshell.py in enable_matplotlib(self, gui) 2953 # Now we must activate the gui pylab wants to use, and fix %run to take 2954 # plot updates into account -> 2955 self.enable_gui(gui) 2956 self.magics_manager.registry['ExecutionMagics'].default_runner = \ 2957 pt.mpl_runner(self.safe_execfile)

/usr/local/lib/python3.6/dist-packages/IPython/terminal/interactiveshell.py in enable_gui(self, gui) 512 if gui: 513 self.active_eventloop, self._inputhook =\ --> 514 get_inputhook_name_and_func(gui) 515 else: 516 self.active_eventloop = self._inputhook = None

/usr/local/lib/python3.6/dist-packages/IPython/terminal/pt_inputhooks/init.py in get_inputhook_name_and_func(gui) 36 37 if gui not in backends: ---> 38 raise UnknownBackend(gui) 39 40 if gui in aliases:

UnknownBackend: No event loop integration for 'inline'. Supported event loops are: qt, qt4, qt5, gtk, gtk2, gtk3, tk, wx, pyglet, glut, osx /usr/local/lib/python3.6/dist-packages/IPython/utils/traitlets.py:5: UserWarning: IPython.utils.traitlets has moved to a top-level traitlets package. warn("IPython.utils.traitlets has moved to a top-level traitlets package.") ------------ Options ------------- D_adam_b1: 0.5 D_adam_b2: 0.999 G_adam_b1: 0.5 G_adam_b2: 0.999 batch_size: 4 bg_replace: False checkpoints_dir: ./outputs/checkpoints/ cond_nc: 3 data_dir: ./dataset/DatasetiPER dataset_mode: iPER debug: False display_freq_s: 300 do_saturate_mask: False face_model: assets/pretrains/sphere20a_20171020.pth fashion_bs: 4 fashion_dir: /public/deep_fashion/intrinsic final_lr: 2e-06 gen_name: impersonator gpu_ids: 0 hmr_model: assets/pretrains/hmr_tf2pt.pth image_size: 256 images_folder: images_HD intervals: 10 is_train: True lambda_D_prob: 1 lambda_face: 1 lambda_lp: 10 lambda_mask: 0.1 lambda_mask_smooth: 1e-05 lambda_style: 5 lambda_vgg: 10 load_epoch: 0 lr_D: 0.0002 lr_G: 0.0002 map_name: uv_seg mask_bce: False model: impersonator n_threads_test: 2 n_threads_train: 4 name: running nepochs_decay: 20 nepochs_no_decay: 10 norm_type: instance num_iters_validate: 1 part_info: assets/pretrains/smpl_part_info.json place_bs: 4 place_dir: ./dataset/DatasetiPER print_freq_s: 60 repeat_num: 6 save_latest_freq_s: 3600 serial_batches: False smpl_model: assets/pretrains/smpl_model.pkl smpls_folder: smpls test_ids_file: val.txt tex_size: 3 time_step: 10 train_G_every_n_iterations: 1 train_ids_file: train.txt use_face: False use_style: False use_vgg: False uv_mapping: assets/pretrains/mapper.txt -------------- End ---------------- ./outputs/checkpoints/running Traceback (most recent call last): File "train.py", line 140, in Train() File "train.py", line 12, in init data_loader_train = CustomDatasetDataLoader(self._opt, is_for_train=True) File "/content/impersonator/data/custom_dataset_data_loader.py", line 10, in init self._create_dataset() File "/content/impersonator/data/custom_dataset_data_loader.py", line 13, in _create_dataset self._dataset = DatasetFactory.get_by_name(self._opt.dataset_mode, self._opt, self._is_for_train) File "/content/impersonator/data/dataset.py", line 23, in get_by_name dataset = ImPerDataset(opt, is_for_train) File "/content/impersonator/data/imper_dataset.py", line 131, in init super(ImPerDataset, self).init(opt, is_for_train) File "/content/impersonator/data/imper_dataset.py", line 22, in init self._read_dataset_paths() File "/content/impersonator/data/imper_dataset.py", line 56, in _read_dataset_paths self._vids_info = self._read_vids_info(use_ids_filepath) File "/content/impersonator/data/imper_dataset.py", line 77, in _read_vids_info assert len(images_path) == len(cams), '{} != {}'.format(len(images_path), len(cams)) AssertionError: 0 != 961

How can i fix this ?

StevenLiuWen commented 4 years ago

@Tayfur26 @haviduck we update the additional files of iPER https://onedrive.live.com/?authkey=%21AJL_NAQMkdXGPlA&id=3705E349C336415F%2188052&cid=3705E349C336415F, and the training details are shown in https://github.com/svip-lab/impersonator/blob/master/doc/train.md. Welcome to clone the latest codes, and follow the training script to train the iPER from scratch.

thalluripk commented 4 years ago

Hi, I have cloned the code and built it on windows 10 surface machine. I experience the following error when execute python demo_imitator.py --gpu_ids 1. Please help

`./outputs/checkpoints/running python : At line:1 char:1

Traceback (most recent call last):

File "demo_imitator.py", line 111, in main()

File "demo_imitator.py", line 102, in main generate_actor_result(test_opt, src_img_path)

File "demo_imitator.py", line 44, in generate_actor_result imitator = Imitator(test_opt) File "C:\Praveen\Research\AI\impersonator\models\imitator.py", line 19, in init self._create_networks()

File "C:\Praveen\Research\AI\impersonator\models\imitator.py", line 28, in _create_networks self.generator = self._create_generator().cuda()

File "C:\Praveen\Research\AI\impersonator\models\imitator.py", line 59, in _create_generator self._load_params(net, self._opt.load_path) File "C:\Praveen\Research\AI\impersonator\models\models.py", line 161, in _load_params load_path), 'Weights file not found. Have you trained a model!? We are not providing one %s' % load_path

AssertionError: Weights file not found. Have you trained a model!? We are not providing one ./outputs/checkpoints/lwb_imper_fashion_place/net_epoch_30_id_G.pth

If you suspect this is an IPython bug, please report it at: https://github.com/ipython/ipython/issues or send an email to the mailing list at ipython-dev@python.org

You can print a more detailed traceback right now with "%tb", or use "%debug" to interactively debug it.

Extra-detailed tracebacks for bug-reporting purposes can be enabled via: %config Application.verbose_crash=True `