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

TypeError in tutorial-1.ipynb #35

Closed
LoveFrootLoops opened this issue Nov 25, 2022 · 2 comments
Closed

TypeError in tutorial-1.ipynb #35

LoveFrootLoops opened this issue Nov 25, 2022 · 2 comments
Labels
bug Something isn't working

Comments

@LoveFrootLoops
Copy link

LoveFrootLoops commented Nov 25, 2022

Tried the jupyternotebook file " tutorial-1.ipynb".

It produced the Error: "TypeError: unsupported format string passed to LabelTensor.format"after the first epoch iteration.


---------------------------------------------------------------------------
TypeError                                 Traceback (most recent call last)
Cell In [3], line 10
      8 pinn.span_pts(20, 'grid', ['D'])
      9 pinn.span_pts(20, 'grid', ['gamma1', 'gamma2', 'gamma3', 'gamma4'])
---> 10 pinn.train(5000, 100)

File ~\PycharmProjects\pythonProject\venv\lib\site-packages\pina\pinn.py:263, in PINN.train(self, stop, frequency_print, trial)
    261         print('[epoch {:05d}] {:.6e} '.format(self.trained_epoch, sum(losses).item()), end='')
    262         for loss in losses:
--> 263             print('{:.6e} '.format(loss), end='')
    264         print()
    266 return sum(losses).item()

File ~\PycharmProjects\pythonProject\venv\lib\site-packages\torch\_tensor.py:855, in Tensor.__format__(self, format_spec)
    853 def __format__(self, format_spec):
    854     if has_torch_function_unary(self):
--> 855         return handle_torch_function(Tensor.__format__, (self,), self, format_spec)
    856     if self.dim() == 0 and not self.is_meta and type(self) is Tensor:
    857         return self.item().__format__(format_spec)

File ~\PycharmProjects\pythonProject\venv\lib\site-packages\torch\overrides.py:1534, in handle_torch_function(public_api, relevant_args, *args, **kwargs)
   1528     warnings.warn("Defining your `__torch_function__ as a plain method is deprecated and "
   1529                   "will be an error in future, please define it as a classmethod.",
   1530                   DeprecationWarning)
   1532 # Use `public_api` instead of `implementation` so __torch_function__
   1533 # implementations can do equality/identity comparisons.
-> 1534 result = torch_func_method(public_api, types, args, kwargs)
   1536 if result is not NotImplemented:
   1537     return result

File ~\PycharmProjects\pythonProject\venv\lib\site-packages\torch\_tensor.py:1278, in Tensor.__torch_function__(cls, func, types, args, kwargs)
   1275     return NotImplemented
   1277 with _C.DisableTorchFunction():
-> 1278     ret = func(*args, **kwargs)
   1279     if func in get_default_nowrap_functions():
   1280         return ret

File ~\PycharmProjects\pythonProject\venv\lib\site-packages\torch\_tensor.py:858, in Tensor.__format__(self, format_spec)
    856 if self.dim() == 0 and not self.is_meta and type(self) is Tensor:
    857     return self.item().__format__(format_spec)
--> 858 return object.__format__(self, format_spec)

TypeError: unsupported format string passed to LabelTensor.__format__
@LoveFrootLoops LoveFrootLoops added the bug Something isn't working label Nov 25, 2022
@ndem0
Copy link
Member

ndem0 commented Nov 28, 2022

Dear @LoveFrootLoops,
thanks for reporting this issues, we are working on it to fix asap

@ndem0
Copy link
Member

ndem0 commented Nov 29, 2022

Fixed in #39
Please let us know if everything works fine now.

@ndem0 ndem0 closed this as completed Nov 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants