vcg-uvic / lf-net-release

Code Release for LF-Net: Learning Local Features from Images
Other
314 stars 66 forks source link

Run demo.ipynb, error happened. In [8]: NameError: name 'RawSfMDataset' is not defined #2

Closed chuanzhidong closed 6 years ago

chuanzhidong commented 6 years ago

NameError Traceback (most recent call last)

in () 1 tf.reset_default_graph() 2 batch_size = 1 # fixed ----> 3 data_loader = RawSfMDataset(longer_edge=640) 4 5 dataset = data_loader.get_dataset(config.dpt_dir, config.img_dir, NameError: name 'RawSfMDataset' is not defined I checked the demo.ipynb, there is no ln [4]. So how to solve the this problem. Thanks.
chuanzhidong commented 6 years ago

python run_lfnet.py --in_dir=images --out_dir=outputs this one works very well

chuanzhidong commented 6 years ago

I tried the notebook codes in ipython. It works. Maybe it is because the jupyter notebook cannot import functions from other folder.

chuanzhidong commented 6 years ago

I solved this issue by changing cell 3: `LOCAL_PATH = '../' if LOCAL_PATH not in sys.path: sys.path.append(LOCAL_PATH) from common.tf_layer_utils import from datasets import from det_tools import from inference import MODEL_PATH = '../models/' if MODEL_PATH not in sys.path: sys.path.append(MODEL_PATH) COMMON_PATH = '../common/' if COMMON_PATH not in sys.path: sys.path.append(COMMON_PATH)

from io_utils import read_text from jupyter_utils import display_image_batch

from eval_tools import draw_match, draw_keypoints

MY_UTILS_PATH = '../../dnnutils/'

if MY_UTILS_PATH not in sys.path:

sys.path.append(MY_UTILS_PATH)

from book_plots import figsize

from jupyter_utils import display_image_batch

import tfvisualizer as tv

from tfvisualizer import log_images, convert_tile_image

from io_utils import load_pickle, read_text

from book_format import load_style

from det_tools import *

from spatial_transformer import transformer_crop, inplane_inverse_warp, inplane_coordinate_warp

load_style()`

to `LOCAL_PATH = '' if LOCAL_PATH not in sys.path: sys.path.append(LOCAL_PATH) from common.tf_layer_utils import from datasets import from det_tools import from inference import MODEL_PATH = 'models/' if MODEL_PATH not in sys.path: sys.path.append(MODEL_PATH) COMMON_PATH = 'common/' if COMMON_PATH not in sys.path: sys.path.append(COMMON_PATH)

from io_utils import read_text from jupyter_utils import display_image_batch

from eval_tools import draw_match, draw_keypoints

MY_UTILS_PATH = '../dnnutils/'

if MY_UTILS_PATH not in sys.path:

sys.path.append(MY_UTILS_PATH)

from book_plots import figsize

from jupyter_utils import display_image_batch

import tfvisualizer as tv

from tfvisualizer import log_images, convert_tile_image

from io_utils import load_pickle, read_text

from book_format import load_style

from det_tools import *

from spatial_transformer import transformer_crop, inplane_inverse_warp, inplane_coordinate_warp

load_style()`

Change cell 5 accordingly. It will be fine.