Git Product home page Git Product logo

Comments (8)

minghaoPA avatar minghaoPA commented on August 19, 2024

I think the shape[0] is to make sure batch sizes are equal to each other. So you need to add an extra '0' dimension as batch size, like line25 and line26 in example3.py.

    vertices, faces = neural_renderer.load_obj(filename_obj)
    self.vertices = vertices[None, :, :]
    self.faces = faces[None, :, :]

Hopefully my understanding is helpful to your problem.

And if you have time, please also take a look at my question #21 , which is also related to save_obj.py.

from neural_renderer.

jay-thakur avatar jay-thakur commented on August 19, 2024

I believe, if we add extra '0' as you suggested, then vertices & faces will be of 3 dimension. & in save_obj() we have assert statement for vertices & faces to 2. Please correct me if i am wrong.

I am expecting to save the .obj with its texture . Do you have working code for the same? Could you please share your example3.py ?

Thanks,
Jay

from neural_renderer.

minghaoPA avatar minghaoPA commented on August 19, 2024

Hi Jay. For your concern, please check out my code at question #21. I am sharing my piece of code there.

But anyway, I just slice out the first dimension and feed the rest into save_obj. And I am also a little confused about your question. The vertices_to_faces is not called either in load_obj.py or save_obj.py. So I don't encounter any problem related to dimension assertion. Maybe it's because you are using torch edition from another repo, not exactly the same code as this repo?

from neural_renderer.

minghaoPA avatar minghaoPA commented on August 19, 2024

For simplicity, here are the codes added before #draw object module in example3.py

    # save obj with textures
    #TODO: textures are not reasonable
    model.textures_1 = cf.concat((model.textures, model.textures.transpose((0, 1, 4, 3, 2, 5))), axis=1)
    neural_renderer.save_obj('result.obj', model.vertices[0], model.faces[0], cf.tanh(model.textures_1[0]).array)

from neural_renderer.

jay-thakur avatar jay-thakur commented on August 19, 2024

Sorry, I am using another repo.

from neural_renderer.

Goldname100 avatar Goldname100 commented on August 19, 2024

@jay-thakur Which repo are you using?

from neural_renderer.

kelly08385 avatar kelly08385 commented on August 19, 2024

I have the same problem when saved the rendered object.
The error said

cupy.cuda.compiler.CompileException: /tmp/tmp72lc77x3/44a6062960e6de87983184b4a18c1a10_2.cubin.cu(20): error: a value of type "const float *" cannot be used to initialize an entity of type "float *"

/tmp/tmp72lc77x3/44a6062960e6de87983184b4a18c1a10_2.cubin.cu(21): error: a value of type "const float *" cannot be used to initialize an entity of type "float *"

/tmp/tmp72lc77x3/44a6062960e6de87983184b4a18c1a10_2.cubin.cu(75): error: expression must be a modifiable lvalue

I think it's chain, cupy or cuda versions problem.
I run in python3.8 and cuda10.2
What chain and cupy version should I select?
thanks

from neural_renderer.

caojiehui avatar caojiehui commented on August 19, 2024

I have the same problem when saved the rendered object. The error said

cupy.cuda.compiler.CompileException: /tmp/tmp72lc77x3/44a6062960e6de87983184b4a18c1a10_2.cubin.cu(20): error: a value of type "const float *" cannot be used to initialize an entity of type "float *"

/tmp/tmp72lc77x3/44a6062960e6de87983184b4a18c1a10_2.cubin.cu(21): error: a value of type "const float *" cannot be used to initialize an entity of type "float *"

/tmp/tmp72lc77x3/44a6062960e6de87983184b4a18c1a10_2.cubin.cu(75): error: expression must be a modifiable lvalue

I think it's chain, cupy or cuda versions problem. I run in python3.8 and cuda10.2 What chain and cupy version should I select? thanks

Hello, I have encountered the same issue as you. How did you resolve this problem? Was it related to the version?

from neural_renderer.

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.