kjunelee / MetaOptNet

Meta-Learning with Differentiable Convex Optimization (CVPR 2019 Oral)
Apache License 2.0
524 stars 97 forks source link

Loading qpth fails on Enum #23

Closed iandreariley closed 5 years ago

iandreariley commented 5 years ago

Hi, thanks for sharing your code!

It looks like qpth uses the enum module which, as I understand it, does not exist in python 2.7, and running train.py fails with the following error

Traceback (most recent call last):
  File "train.py", line 12, in <module>
    from models.classification_heads import ClassificationHead
  File "/misc/cephfs/home/smarts/ian/MetaOptNet/models/classification_heads.py", line 7, in <module>
    from qpth.qp import QPFunction
  File "/opt/smarts/envs/py27_pytorch/lib/python2.7/site-packages/qpth/__init__.py", line 3, in <module>
    from . import qp
  File "/opt/smarts/envs/py27_pytorch/lib/python2.7/site-packages/qpth/qp.py", line 6, in <module>
    from .solvers.pdipm import batch as pdipm_b
  File "/opt/smarts/envs/py27_pytorch/lib/python2.7/site-packages/qpth/solvers/pdipm/batch.py", line 2, in <module>
    from enum import Enum
ImportError: No module named enum

Can you explain how you're loading this in a python 2.7 environment? Thanks again!

iandreariley commented 5 years ago

nvm. Installing the enum34 package solved it.