GithubHelp home page GithubHelp logo

Comments (10)

rockerritesh avatar rockerritesh commented on May 20, 2024 6

yesπŸ‘πŸ‘" import keras " best solution!!❀❀

from srgan-tensorflow.

AdrienLF avatar AdrienLF commented on May 20, 2024 1

You need to add "import keras" in lib/ops.py

from srgan-tensorflow.

perdigas91 avatar perdigas91 commented on May 20, 2024

@nickhdfan, did you managed to solve this? I'm having the same problem. Supposably only tensorflow was needed.

from srgan-tensorflow.

ryancom16 avatar ryancom16 commented on May 20, 2024

Add the following to ops.py
import keras

apparently keras is actually a dependency for vgg54 training. If you are planning on training vgg54, you will also have to make the change to the following lines of model.py starting at around line 335. change them to look like this:

if type == 'VGG54':
    target_layer = 'vgg_19/conv5/conv5_4'
elif type == 'VGG22':
    target_layer = 'vgg_19/conv2/conv2_2'

from srgan-tensorflow.

hhsm95 avatar hhsm95 commented on May 20, 2024

Hi, I have the same error, and the proposed solution didn't work for me, instead I get this new error:

InvalidArgumentError (see above for traceback): Cannot assign a device for operation 'dicriminator_train/discriminator/discriminator_unit/dense_layer_2/dense/bias/Adam_1': Operation was explicitly assigned to /device:GPU:0 but available devices are [ /job:localhost/replica:0/task:0/device:CPU:0 ]. Make sure the device specification refers to a valid device.
	 [[Node: dicriminator_train/discriminator/discriminator_unit/dense_layer_2/dense/bias/Adam_1 = VariableV2[_class=["loc:@discriminator/discriminator_unit/dense_layer_2/dense/bias"], container="", dtype=DT_FLOAT, shape=[1], shared_name="", _device="/device:GPU:0"]()]]

Someone knows why this happens and how to solve it?

from srgan-tensorflow.

lxk1990727 avatar lxk1990727 commented on May 20, 2024

i meet the same question, pip install keras, but doesn't work.
AttributeError: 'module' object has no attribute 'leaky_relu'

from srgan-tensorflow.

ryancom16 avatar ryancom16 commented on May 20, 2024

@adeoy I believe that you have either installed regular tensorflow (not tensorflow-gpu) or you set CUDA_VISIBLE_DEVICES incorrectly when running the training script.
Note: pip install tensorflow-gpu is a different from pip install tensorflow

@lxk1990727 Sounds like you need to update your tensorflow.

from srgan-tensorflow.

hhsm95 avatar hhsm95 commented on May 20, 2024

@ryancom16 In fact I installed regular Tensorflow because I dont a GPU on my PC, but my processors are powerful enough to make this tasks. So, I cant do the next training without a GPU? Or how can I solve this problem?

from srgan-tensorflow.

AdrienLF avatar AdrienLF commented on May 20, 2024

Still have the same issue, anyone found a solution?

from srgan-tensorflow.

eric-guerin avatar eric-guerin commented on May 20, 2024

I had the same issue during the second step training (SRGAN with MSE loss) and it was solved by adding "import keras" in lib/ops.py

from srgan-tensorflow.

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.