TensorLayerX icon indicating copy to clipboard operation
TensorLayerX copied to clipboard

ImportError: cannot import name 'distributed_init' from 'tensorlayerx.backend.ops.load_backend'

Open AnsonCNS opened this issue 2 years ago • 5 comments

New Issue Checklist

Issue Description

When running with tensorflow as backend, it gives this error which relates to the tensorlayerx package.

ImportError: cannot import name 'distributed_init' from 'tensorlayerx.backend.ops.load_backend'

I think the issue is caused by the add torch distribution commit, where there is no distributed_init() in tensorflow_backend.py.

Reproducible Code

  • Which OS are you using ? Windows 10, Python3.8, Cuda10.2,

  • Please provide a reproducible code of your issue. Without any reproducible code, you will probably not receive any help.

I'm trying to run the SRGAN project train.py --mode=eval with tensorflow as backend and with the given pretrained tensorflow weights.

AnsonCNS avatar Aug 29 '23 02:08 AnsonCNS

Hello, I also encounter this issue, have you any progress

sinnuswong avatar Sep 13 '23 07:09 sinnuswong

will fix soon

zsdonghao avatar Sep 13 '23 08:09 zsdonghao

HI thanks for your response I still have the same issue, any update?

aemrhb avatar Sep 14 '23 11:09 aemrhb

HI thanks for your response I still have the same issue, any update?

Can you give a sample code? @aemrhb @AnsonCNS

QuantumLiu avatar Sep 15 '23 08:09 QuantumLiu

@QuantumLiu I was running the code from the SRGAN project. And setting tensorflow as backend within the SRGAN train.py:

os.environ['TL_BACKEND'] = 'tensorflow'

I used the pretrained tensorflow model weights g and d provided by the project.

But I get the mentioned issue when I run the SRGAN project in eval mode.

python train.py --mode=eval

AnsonCNS avatar Sep 18 '23 01:09 AnsonCNS