python - Import not working when file is located in same directory and calling script -


i'm not sure if title of question correct, mods please feel free change it.

i'm working through cs231n convolutional neural networks visual recognition course online , i've hit weird error. first attempt @ real python programming simple error, or more complicated.

i'm using python 2.7, anaconda, , windows 7.

when trying run script following error;

nameerror: global name 'im2col_cython' not defined 

my understanding far occurs because fails (and calls exception);

try:   cs231n.im2col_cython import col2im_cython, im2col_cython   cs231n.im2col_cython import col2im_6d_cython except importerror:   print 'run following cs231n directory , try again:'   print 'python setup.py build_ext --inplace'   print 'you may need restart ipython kernel' 

i've tried figure out why may case. first off have run setup.py turn im2col_cython.pyx other files. seems run @ 1 point have warning;

warning: extension name 'im2col_cython' not match qualified name 'cs231n.im2col_cython' of 'im2col_cython.pyx' 

my figuring here it's issue fact folder tree have looks this; assignment 2 ->cs231n

inside cs231n setup.py , im2col_cython.pyx files located. i've installed cython, , have vc python2.7 installed. when run setup.py creates 2 new files;

im2col_cython.c im2col_cython.pyd 

but have no idea if that's it's meant or anything. i'm in way on head (0 python knowledge), i'm keen learn!

edit 1 script imports im2col_cython here

the im2col_cython file here

edit 2

when including following in exception clause;

  import traceback; traceback.print_exc() 

i output;

traceback (most recent call last):   file "fast_layers.py", line 3, in <module>     cs231n.im2col_cython import col2im_cython, im2col_cython importerror: no module named cs231n.im2col_cython 


Comments

Popular posts from this blog

Command prompt result in label. Python 2.7 -

javascript - How do I use URL parameters to change link href on page? -

amazon web services - AWS Route53 Trying To Get Site To Resolve To www -