Coder Social home page Coder Social logo

Comments (2)

maxifischer avatar maxifischer commented on July 2, 2024

I reproduced the error and it seems to correspond to IPython storing sys.argv. When clearing the directory after importing sys, it works for me.
import sys; sys.path.append('..'); sys.argv=['']

from deepadots.

danthe96 avatar danthe96 commented on July 2, 2024
---------------------------------------------------------------------------
SystemExit                                Traceback (most recent call last)
<ipython-input-34-0377821d631a> in <module>()
      1 import numpy as np
      2 import pandas as pd
----> 3 from src.algorithms import LSTM_AD

~/Onedrive/HPI/Material/SS 2018/MP/MP-2018/src/algorithms/__init__.py in <module>()
      4 from .donut import Donut
      5 from .lstm_ad import LSTMAD
----> 6 from .lstm_enc_dec import LSTM_Enc_Dec
      7 
      8 __all__ = ['Algorithm', 'DAGMM', 'Donut', 'RecurrentEBM', 'LSTMAD', 'LSTM_Enc_Dec']

~/Onedrive/HPI/Material/SS 2018/MP/MP-2018/src/algorithms/lstm_enc_dec.py in <module>()
     12 import pandas as pd
     13 from third_party.lstm_enc_dec.anomalyDetector import fit_norm_distribution_param
---> 14 from third_party.lstm_enc_dec import train_predictor
     15 from third_party.lstm_enc_dec import anomaly_detection
     16 from third_party.lstm_enc_dec import preprocess_data

~/Onedrive/HPI/Material/SS 2018/MP/MP-2018/third_party/lstm_enc_dec/train_predictor.py in <module>()
     62 parser.add_argument('--prediction_window_size', type=int, default=10,
     63                     help='prediction_window_size')
---> 64 args = parser.parse_args()
     65 # Set the random seed manually for reproducibility.
     66 torch.manual_seed(args.seed)

/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/argparse.py in parse_args(self, args, namespace)
   1731         if argv:
   1732             msg = _('unrecognized arguments: %s')
-> 1733             self.error(msg % ' '.join(argv))
   1734         return args
   1735 

/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/argparse.py in error(self, message)
   2387         self.print_usage(_sys.stderr)
   2388         args = {'prog': self.prog, 'message': message}
-> 2389         self.exit(2, _('%(prog)s: error: %(message)s\n') % args)

/usr/local/Cellar/python/3.6.5/Frameworks/Python.framework/Versions/3.6/lib/python3.6/argparse.py in exit(self, status, message)
   2374         if message:
   2375             self._print_message(message, _sys.stderr)
-> 2376         _sys.exit(status)
   2377 
   2378     def error(self, message):

SystemExit: 2

usage: __main__.py [-h] [--data DATA] [--filename FILENAME] [--model MODEL]
                   [--augment_train_data AUGMENT_TRAIN_DATA] [--emsize EMSIZE]
                   [--nhid NHID] [--nlayers NLAYERS] [--res_connection]
                   [--lr LR] [--weight_decay WEIGHT_DECAY] [--clip CLIP]
                   [--epochs EPOCHS] [--batch_size N] [--eval_batch_size N]
                   [--bptt BPTT]
                   [--teacher_forcing_ratio TEACHER_FORCING_RATIO]
                   [--dropout DROPOUT] [--tied] [--seed SEED]
                   [--device DEVICE] [--log_interval N] [--save_interval N]
                   [--resume] [--pretrained]
                   [--prediction_window_size PREDICTION_WINDOW_SIZE]
__main__.py: error: unrecognized arguments: -f /Users/danthe/Library/Jupyter/runtime/kernel-c4b5debc-35f2-4a17-bcdf-584e04a8fe11.json
An exception has occurred, use %tb to see the full traceback.

SystemExit: 2


/usr/local/lib/python3.6/site-packages/IPython/core/interactiveshell.py:2971: UserWarning: To exit: use 'exit', 'quit', or Ctrl-D.
  warn("To exit: use 'exit', 'quit', or Ctrl-D.", stacklevel=1)

Here's a more detailed traceback. The issue seems to be in third_party.train_predictor which defines a ton of arguments at file level for whatever reason.

from deepadots.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.