Navigation

    Quantiacs Community

    • Register
    • Login
    • Search
    • Categories
    • News
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    RuntimeError: expand(torch.DoubleTensor{[694, 6]}, size=[694]): the number of sizes provided (1) must be greater or equal to the number of dimensions in the tensor (2)

    Strategy help
    2
    4
    218
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • illustrious.felice
      illustrious.felice last edited by

      Hello,

      I am cloning the Q18 neural network example (LSTM) and running it. I noticed that when I leave the get_features function with only 1 feature, the model runs normally
      Screenshot 2024-03-02 224511.png
      I plan to use more features as follows:
      Screenshot 2024-03-02 224556.png
      And got the following error
      ea046276-cbba-4947-b5f6-d2b667c1ad0f-image.png
      65f0558a-daeb-456c-a6b8-4622d12f1c96-image.png
      Screenshot 2024-03-02 224947.png

      Please show me how to fix the error so that I can apply more features. I only edited the get_features function, all the remaining code is the same as the Q18 neural network example

      Please help me. Thank you so much.

      illustrious.felice 1 Reply Last reply Reply Quote 0
      • illustrious.felice
        illustrious.felice @illustrious.felice last edited by illustrious.felice

        @illustrious-felice Please help me fix this error. @support @Vyacheslav_B

        support 1 Reply Last reply Reply Quote 0
        • support
          support @illustrious.felice last edited by

          @illustrious-felice It looks like your feature is prepared in a way that the computation of a log with argument zero is involved, which triggers an error. You need to handle this case, for example with a try/except clause.

          illustrious.felice 1 Reply Last reply Reply Quote 0
          • illustrious.felice
            illustrious.felice @support last edited by

            @support Thank you so much. I have resolved this error

            1 Reply Last reply Reply Quote 0
            • First post
              Last post
            Powered by NodeBB | Contributors
            • Documentation
            • About
            • Career
            • My account
            • Privacy policy
            • Terms and Conditions
            • Cookies policy
            Home
            Copyright © 2014 - 2021 Quantiacs LLC.
            Powered by NodeBB | Contributors