GithubHelp home page GithubHelp logo

Comments (8)

DeepBlurt avatar DeepBlurt commented on August 20, 2024

Traceback (most recent call last):
File "train.py", line 43, in
model.train()
File "/home/ax/Anomaly/GANomaly/lib/model.py", line 280, in train
res = self.test()
File "/home/ax/Anomaly/GANomaly/lib/model.py", line 354, in test
auc = evaluate(self.gt_labels, self.an_scores, metric=self.opt.metric)
File "/home/ax/Anomaly/GANomaly/lib/evaluate.py", line 24, in evaluate
return roc(labels, scores)
File "/home/ax/Anomaly/GANomaly/lib/evaluate.py", line 49, in roc
fpr, tpr, _ = roc_curve(labels.numpy(), scores.numpy())
File "/home/ax/anaconda3/lib/python3.6/site-packages/sklearn/metrics/ranking.py", line 622, in roc_curve
y_true, y_score, pos_label=pos_label, sample_weight=sample_weight)
File "/home/ax/anaconda3/lib/python3.6/site-packages/sklearn/metrics/ranking.py", line 402, in _binary_clf_curve
assert_all_finite(y_score)
File "/home/ax/anaconda3/lib/python3.6/site-packages/sklearn/utils/validation.py", line 72, in assert_all_finite
_assert_all_finite(X.data if sp.issparse(X) else X, allow_nan)
File "/home/ax/anaconda3/lib/python3.6/site-packages/sklearn/utils/validation.py", line 56, in _assert_all_finite
raise ValueError(msg_err.format(type_err, X.dtype))
ValueError: Input contains NaN, infinity or a value too large for dtype('float32')

from ganomaly.

DeepBlurt avatar DeepBlurt commented on August 20, 2024

I guess the reason lies in the version of sklearn, or pytorch, But I don't know the exact version you used, waiting for your answer!
-------------------update-------------------
I down grade the version of sklearn, the error evaded, but the AUC result got nan:
Avg Run Time (ms/batch): 8.383 AUC: nan max AUC: 0.000

Could you please point out the reason?

from ganomaly.

lzzlxxlsz avatar lzzlxxlsz commented on August 20, 2024

have you run the code successufully? and how about the result?

from ganomaly.

DeepBlurt avatar DeepBlurt commented on August 20, 2024

have you run the code successufully? and how about the result?

I have run successfully, the result differs from the article, I got following AUC:

0.7897 , 0.4115 , 0.7857 , 0.6432 , 0.6759 , 0.7587, 0.745 , 0.5428 , 0.8484 , 0.5741
in MNIST, does this result make sense? Can you offer your result?

I modified the train step in code, because if not, it does not do any training, thus got NaN error. I make train step equal to ratio of number of samples and batch size per epoch.

from ganomaly.

lzzlxxlsz avatar lzzlxxlsz commented on August 20, 2024

sorry,I don't run this code.and does the result be similar with the test image?

from ganomaly.

Funple avatar Funple commented on August 20, 2024

have you run the code successufully? and how about the result?

I have run successfully, the result differs from the article, I got following AUC:

0.7897 , 0.4115 , 0.7857 , 0.6432 , 0.6759 , 0.7587, 0.745 , 0.5428 , 0.8484 , 0.5741
in MNIST, does this result make sense? Can you offer your result?

I modified the train step in code, because if not, it does not do any training, thus got NaN error. I make train step equal to ratio of number of samples and batch size per epoch.

Could you provide your changed code?

from ganomaly.

DeepBlurt avatar DeepBlurt commented on August 20, 2024

I find this code not stable, then I tried this code:
https://github.com/caiya55/ganomaly-tensorflow , you can have a try, this code is much stable and easy to understand.

from ganomaly.

Funple avatar Funple commented on August 20, 2024

Thank you for your effective reply.

from ganomaly.

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.