nerfactor
nerfactor copied to clipboard
Question about incompatible shapes(0,3) and (100,3) at II. Joint Optimization in Training, Validation, and Testing
Hi, thank you for the inspiring work and your open source code!When I run the following script, I get an ValueError report the at step II. Joint Optimization in Training, Validation, and Testing: I. Shape Pre-Training and II. Joint Optimization (training and validation)
'''
scene='hotdog_2163' gpus='2' model='nerfactor' overwrite='True' proj_root='/lyy/nerfactor' repo_dir="$proj_root/nerfactor" viewer_prefix='' # or just use ''
I. Shape Pre-Training
data_root="$proj_root/data/selected/$scene" if [[ "$scene" == scan* ]]; then # DTU scenes imh='256' else imh='512' fi if [[ "$scene" == pinecone || "$scene" == vasedeck || "$scene" == scan* ]]; then # Real scenes: NeRF & DTU near='0.1'; far='2' else near='2'; far='6' fi if [[ "$scene" == pinecone || "$scene" == vasedeck || "$scene" == scan* ]]; then # Real scenes: NeRF & DTU use_nerf_alpha='True' else use_nerf_alpha='False' fi surf_root="$proj_root/output/surf/$scene" shape_outdir="$proj_root/output/train/${scene}_shape" REPO_DIR="$repo_dir" "$repo_dir/nerfactor/trainvali_run.sh" "$gpus" --config='shape.ini' --config_override="data_root=$data_root,imh=$imh,near=$near,far=$far,use_nerf_alpha=$use_nerf_alpha,data_nerf_root=$surf_root,outroot=$shape_outdir,viewer_prefix=$viewer_prefix,overwrite=$overwrite"
II. Joint Optimization (training and validation)
shape_ckpt="$shape_outdir/lr1e-2/checkpoints/ckpt-2" brdf_ckpt="$proj_root/output/train/merl/lr1e-2/checkpoints/ckpt-50" if [[ "$scene" == pinecone || "$scene" == vasedeck || "$scene" == scan* ]]; then # Real scenes: NeRF & DTU xyz_jitter_std=0.001 else xyz_jitter_std=0.01 fi test_envmap_dir="$proj_root/data/envmaps/for-render_h16/test" shape_mode='finetune' outroot="$proj_root/output/train/${scene}_$model" REPO_DIR="$repo_dir" "$repo_dir/nerfactor/trainvali_run.sh" "$gpus" --config="$model.ini" --config_override="data_root=$data_root,imh=$imh,near=$near,far=$far,use_nerf_alpha=$use_nerf_alpha,data_nerf_root=$surf_root,shape_model_ckpt=$shape_ckpt,brdf_model_ckpt=$brdf_ckpt,xyz_jitter_std=$xyz_jitter_std,test_envmap_dir=$test_envmap_dir,shape_mode=$shape_mode,outroot=$outroot,viewer_prefix=$viewer_prefix,overwrite=$overwrite"
III. Simultaneous Relighting and View Synthesis (testing)
ckpt="$outroot/lr5e-3/checkpoints/ckpt-10" if [[ "$scene" == pinecone || "$scene" == vasedeck || "$scene" == scan* ]]; then # Real scenes: NeRF & DTU color_correct_albedo='false' else color_correct_albedo='true' fi REPO_DIR="$repo_dir" "$repo_dir/nerfactor/test_run.sh" "$gpus" --ckpt="$ckpt" --color_correct_albedo="$color_correct_albedo"
'''
[trainvali] For results, see:
/lyy/nerfactor/output/train/hotdog_2163_nerfactor/lr5e-3
[datasets/nerf_shape] Number of 'train' views: 100
[datasets/nerf_shape] Number of 'vali' views: 8
[models/base] Trainable layers registered:
['net_normal_mlp_layer0', 'net_normal_mlp_layer1', 'net_normal_mlp_layer2', 'net_normal_mlp_layer3', 'net_normal_out_layer0', 'net_lvis_mlp_layer0', 'net_lvis_mlp_layer1', 'net_lvis_mlp_layer2', 'net_lvis_mlp_layer3', 'net_lvis_out_layer0']
[models/base] Trainable layers registered:
['net_brdf_mlp_layer0', 'net_brdf_mlp_layer1', 'net_brdf_mlp_layer2', 'net_brdf_mlp_layer3', 'net_brdf_out_layer0']
Traceback (most recent call last):
File "/lyy/nerfactor/nerfactor/nerfactor/trainvali.py", line 341, in
The shape checkpoints are generated by step I. Shape Pre-Training and the BRDF checkpoints are downloaded from your page. Does it mean i need to pre-train brdf model by myself?
Very much looking forward to your help!