Giter VIP home page Giter VIP logo

Comments (6)

hao-zi avatar hao-zi commented on May 18, 2024

when i change NCHW to NHWC in tflib/ops/conv1d.py, i get errors:

Traceback (most recent call last):
  File "sample.py", line 79, in <module>
    fake_inputs = models.Generator(args.batch_size, args.seq_length, args.layer_dim, len(charmap))
  File "/home/tf/passgam/PassGAN-master/models.py", line 19, in Generator
    output = ResBlock('Generator.1', output, layer_dim)
  File "/home/tf/passgam/PassGAN-master/models.py", line 9, in ResBlock
    output = lib.ops.conv1d.Conv1D(name+'.1', dim, dim, 5, output)
  File "/home/tf/passgam/PassGAN-master/tflib/ops/conv1d.py", line 93, in Conv1D
    data_format='NHWC'
  File "/home/tf/tensorflow/lib/python2.7/site-packages/tensorflow/python/ops/nn_ops.py", line 2204, in conv1d
    data_format=data_format)
  File "/home/tf/tensorflow/lib/python2.7/site-packages/tensorflow/python/ops/gen_nn_ops.py", line 631, in conv2d
    data_format=data_format, name=name)
  File "/home/tf/tensorflow/lib/python2.7/site-packages/tensorflow/python/framework/op_def_library.py", line 787, in _apply_op_helper
    op_def=op_def)
  File "/home/tf/tensorflow/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2958, in create_op
    set_shapes_for_outputs(ret)
  File "/home/tf/tensorflow/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2209, in set_shapes_for_outputs
    shapes = shape_func(op)
  File "/home/tf/tensorflow/lib/python2.7/site-packages/tensorflow/python/framework/ops.py", line 2159, in call_with_requiring
    return call_cpp_shape_fn(op, require_shape_fn=True)
  File "/home/tf/tensorflow/lib/python2.7/site-packages/tensorflow/python/framework/common_shapes.py", line 627, in call_cpp_shape_fn
    require_shape_fn)
  File "/home/tf/tensorflow/lib/python2.7/site-packages/tensorflow/python/framework/common_shapes.py", line 691, in _call_cpp_shape_fn_impl
    raise ValueError(err.message)
ValueError: Dimensions must be equal, but are 10 and 128 for 'Generator.1.1/conv1d/Conv2D' (op: 'Conv2D') with input shapes: [1024,1,128,10], [1,5,128,128].

from passgan.

brannondorsey avatar brannondorsey commented on May 18, 2024

It looks like you are running this on a CPU. If I remember correctly, I've run into this issue with Tensorflow CNNs run on CPUs before. I've only tested this code on CUDA supported GPU devices. I don't have the bandwidth to dig into CPU support right now, especially given how slow the performance will likely be, but likely others have posted on this or a similar issue w/ tensorflow conv2D before.

Good luck!

from passgan.

mikeryan avatar mikeryan commented on May 18, 2024

I'm having the same problem. How do you get the code to run on a GPU? I installed tensorflow using pip and my system has several nVidia 1080 GPUs, but the code does not appear to use them.

from passgan.

brannondorsey avatar brannondorsey commented on May 18, 2024

@mikeryan, this should do the trick:

pip Install tensorflow-gpu

I'll add that to the requirements.txt file and upload it tonight.

from passgan.

mikeryan avatar mikeryan commented on May 18, 2024

from passgan.

iBM88 avatar iBM88 commented on May 18, 2024

I have the same problem. The packages mikeryan mentioned are already installed on my machine with version 7.5. I installed cuDNN too but it didn't help. Any ideas?

from passgan.

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.