utkuozbulak / pytorch-cnn-adversarial-attacks Goto Github PK
View Code? Open in Web Editor NEWPytorch implementation of convolutional neural network adversarial attack techniques
License: MIT License
Pytorch implementation of convolutional neural network adversarial attack techniques
License: MIT License
RuntimeError Traceback (most recent call last)
in ()
----> 1 FGS_untargeted.generate(original_image, org_class, target_class)
in generate(self, original_image, org_class, target_class)
48 out = self.model(processed_image)
49 # Calculate CE loss
---> 50 pred_loss = ce_loss(out, im_label_as_var)
51 # Do backward pass
52 pred_loss.backward()
~\anaconda3\lib\site-packages\torch\nn\modules\module.py in call(self, *input, **kwargs)
475 result = self._slow_forward(*input, **kwargs)
476 else:
--> 477 result = self.forward(*input, **kwargs)
478 for hook in self._forward_hooks.values():
479 hook_result = hook(self, input, result)
~\anaconda3\lib\site-packages\torch\nn\modules\loss.py in forward(self, input, target)
860 def forward(self, input, target):
861 return F.cross_entropy(input, target, weight=self.weight,
--> 862 ignore_index=self.ignore_index, reduction=self.reduction)
863
864
~\anaconda3\lib\site-packages\torch\nn\functional.py in cross_entropy(input, target, weight, size_average, ignore_index, reduce, reduction)
1548 if size_average is not None or reduce is not None:
1549 reduction = _Reduction.legacy_get_string(size_average, reduce)
-> 1550 return nll_loss(log_softmax(input, 1), target, weight, None, ignore_index, None, reduction)
1551
1552
~\anaconda3\lib\site-packages\torch\nn\functional.py in nll_loss(input, target, weight, size_average, ignore_index, reduce, reduction)
1405 .format(input.size(0), target.size(0)))
1406 if dim == 2:
-> 1407 return torch._C._nn.nll_loss(input, target, weight, _Reduction.get_enum(reduction), ignore_index)
1408 elif dim == 4:
1409 return torch._C._nn.nll_loss2d(input, target, weight, _Reduction.get_enum(reduction), ignore_index)
RuntimeError: Expected object of type torch.LongTensor but found type torch.IntTensor for argument #2 'target'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.