andersy005 / keras-faster-rcnn

Faster R-CNN: Towards Real-Time Object Detection with Region Proposal Networks
MIT License
29 stars 12 forks source link

UnboundLocalError: local variable 'code' referenced before assignment #2

Open hiteshnitetc opened 6 years ago

hiteshnitetc commented 6 years ago

After executing following line : from data import pascal_voc_parser as p

getting error:

importing Jupyter notebook from /home/nd/keras-faster-rcnn-master/data/pascal_voc_parser.ipynb

UnboundLocalErrorTraceback (most recent call last)
<ipython-input-9-6e3d7e764de9> in <module>()
----> 1 from data import pascal_voc_parser as p

/home/nd/anaconda3/lib/python3.6/importlib/_bootstrap.py in _find_and_load(name, import_)

/home/nd/anaconda3/lib/python3.6/importlib/_bootstrap.py in _find_and_load_unlocked(name, import_)

/home/nd/anaconda3/lib/python3.6/importlib/_bootstrap.py in _load_unlocked(spec)

/home/nd/anaconda3/lib/python3.6/importlib/_bootstrap.py in _load_backward_compatible(spec)

<ipython-input-5-928f04d1cf08> in load_module(self, fullname)
     38                         code = self.shell.input_transformer_manager.transform_cell(cell.source)
     39                         # run the code in themodule
---> 40                     exec(code, mod.__dict__)
     41         finally:
     42             self.shell.user_ns = save_user_ns

UnboundLocalError: local variable 'code' referenced before assignment
hiteshnitetc commented 6 years ago

Waiting for response

andersy005 commented 6 years ago

@hiteshnitetc, I think I know what it is happening. And it has to do with how the jupyter notebook is being imported. I have a script here that does the import for me and I have placed it one of my personal projects (https://github.com/andersy005/themachine/blob/master/themachine/nbfinder.py).

Copy that script to your project working directory and getting back to me if it doesn't work and I will see what I can do to help.

andersy005 commented 6 years ago

wait, I just inspected the error and I think something else is going on. I will take a look at it and I will get back to you.

hiteshnitetc commented 6 years ago

Have to got solution

hiteshnitetc commented 6 years ago

You Got solution?