Giter Site home page Giter Site logo

Invalid syntax error about shapenet HOT 12 CLOSED

justusschock avatar justusschock commented on June 2, 2024
Invalid syntax error

from shapenet.

Comments (12)

justusschock avatar justusschock commented on June 2, 2024

I just checked again and the given Code runs fine for me. Does it say, why the syntax is invalid?

from shapenet.

divastar avatar divastar commented on June 2, 2024

Hi
I guess this Syntax
model: torch.nn.Module
(the ":")
thank you

from shapenet.

divastar avatar divastar commented on June 2, 2024

File "C:\Users\korrine\AppData\Local\Continuum\anaconda3\envs\pytorch_new\lib\site-packages\shapenet\networks\single_shape_init_.py", line 4, in
from .shape_network import ShapeNetwork as SingleShapeNetwork
File "C:\Users\korrine\AppData\Local\Continuum\anaconda3\envs\pytorch_new\lib\site-packages\shapenet\networks\single_shape\shape_network.py", line 158
def model(self, model: torch.nn.Module):
^
SyntaxError: invalid syntax

from shapenet.

justusschock avatar justusschock commented on June 2, 2024

Are you using python 2.7? Because this syntax should be fine with 3.x

from shapenet.

divastar avatar divastar commented on June 2, 2024

I am using python 3.7

from shapenet.

divastar avatar divastar commented on June 2, 2024

Is it possible somehow to overcome this?
thank you

from shapenet.

justusschock avatar justusschock commented on June 2, 2024

This should usually work. I just set up a conda environment with python 3.7 on windows and everything works for me.

To overcome this: This might be possible, but require some work. The value behind the ":" is only a type indication (also used for code completion), but it is not necessary for the code itself. Theoretically you should be able to delete these values (including the ":"). The disadvantage is, that you'd have to do it yourself and this kind of type-annotation is used quite often in this repo.

If you decide to do so, I'd be curious if this will fix your issue.

from shapenet.

divastar avatar divastar commented on June 2, 2024

Are you using python 3.6?

from shapenet.

divastar avatar divastar commented on June 2, 2024

You use 3.7 like me . saw it .

from shapenet.

justusschock avatar justusschock commented on June 2, 2024

I've already used it with python 3.5, 3.6 and 3.7 and never had these issues.

EDIT: The CI/CD also runs with python 3.7 without any issues (as you can see here).

from shapenet.

divastar avatar divastar commented on June 2, 2024

somehow it working after I exchanged scipy.misc import imsave with imageio in util.py

from shapenet.

justusschock avatar justusschock commented on June 2, 2024

Strange, but great that it works now. Maybe there was a hidden error in scipy, which propagated through all the code.

from shapenet.

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.