Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in running code on CPU. #8

Closed
parimuns opened this issue Aug 27, 2020 · 1 comment
Closed

Error in running code on CPU. #8

parimuns opened this issue Aug 27, 2020 · 1 comment

Comments

@parimuns
Copy link

parimuns commented Aug 27, 2020

Hello
I am trying to reproduce the code for power scheduling. But I don't have access to GPU , so I am running codes on a windows system with CPU.In your code,I have removed cuda() wherever it was written.But I am getting errors which I am not able to resolve.Your support in solving issues will be highly appreciated.
I have attached modified main.py and nets.py files.

For power scheduling,I am getting error in main file as
model_rmse = nets.run_rmse_net(model_rmse, variables_rmse, X_train, Y_train)

files.zip

`AttributeError Traceback (most recent call last)
in
----> 1 model_rmse = nets.run_rmse_net(model_rmse, variables_rmse, X_train, Y_train)

~\Untitled Folder 1\nets.py in run_rmse_net(model, variables, X_train, Y_train)
42 model.train()
43 train_loss = nn.MSELoss()(
---> 44 model(variables['X_train_']), variables['Y_train_'])
45 train_loss.backward()
46 opt.step()

c:\users\appdata\local\programs\python\python37\lib\site-packages\torch\nn\modules\module.py in _call_impl(self, *input, **kwargs)
720 result = self._slow_forward(*input, **kwargs)
721 else:
--> 722 result = self.forward(*input, **kwargs)
723 for hook in itertools.chain(
724 _global_forward_hooks.values(),

c:\users\appdata\local\programs\python\python37\lib\site-packages\torch\nn\modules\loss.py in forward(self, input, target)
443
444 def forward(self, input: Tensor, target: Tensor) -> Tensor:
--> 445 return F.mse_loss(input, target, reduction=self.reduction)
446
447

c:\users\appdata\local\programs\python\python37\lib\site-packages\torch\nn\functional.py in mse_loss(input, target, size_average, reduce, reduction)
2633 mse_loss, tens_ops, input, target, size_average=size_average, reduce=reduce,
2634 reduction=reduction)
-> 2635 if not (target.size() == input.size()):
2636 warnings.warn("Using a target size ({}) that is different to the input size ({}). "
2637 "This will likely lead to incorrect results due to broadcasting. "

AttributeError: 'tuple' object has no attribute 'size'
`

@priyald17
Copy link
Member

I have updated the code to use the newest version of PyTorch (76d19e4), which should hopefully resolve this issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants