Skip to content
This repository has been archived by the owner on Nov 21, 2023. It is now read-only.

detectron infer.py error and few import errors (python 3 related) #548

Closed
pjspillai opened this issue Jul 6, 2018 · 1 comment
Closed

Comments

@pjspillai
Copy link

### Error for the function below
assert isinstance(cfg_to_load, (file, basestring)),
NameError: name 'file' is not defined

def load_cfg(cfg_to_load):
    """Wrapper around yaml.load used for maintaining backward compatibility"""
    assert isinstance(cfg_to_load, (file, basestring)), \
        'Expected {} or {} got {}'.format(file, basestring, type(cfg_to_load))
    if isinstance(cfg_to_load, file):
        cfg_to_load = ''.join(cfg_to_load.readlines())
    if isinstance(cfg_to_load, basestring):
        for old_module, new_module in iteritems(_RENAMED_MODULES):
            # yaml object encoding: !!python/object/new:<module>.<object>
            old_module, new_module = 'new:' + old_module, 'new:' + new_module
            cfg_to_load = cfg_to_load.replace(old_module, new_module)
    return yaml.load(cfg_to_load)

### Also, I am getting a few other import errors:
import cPickle as pickle
import Queue
import urllib2

I modified the scripts to correct these for now

I am using Python 3.6.4 (within Anaconda)

@gadcam
Copy link
Contributor

gadcam commented Jul 9, 2018

See #85 & #110

@ir413 ir413 closed this as completed Jul 12, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants