Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

AttributeError: module 'tensorflow' has no attribute 'log' #48

Open
ahbon123 opened this issue Nov 13, 2019 · 2 comments
Open

AttributeError: module 'tensorflow' has no attribute 'log' #48

ahbon123 opened this issue Nov 13, 2019 · 2 comments

Comments

@ahbon123
Copy link

Hello, may I ask how to deal with Traceback error? Thanks.

I use Ubuntu 18.04, with GPU GeForce RTX 2080 with Max-Q.

Traceback (most recent call last): File "train.py", line 113, in <module> main() File "train.py", line 87, in main model.compile(optimizer=opt, loss=loss_type, metrics=[PSNR]) File "/usr/local/lib/python3.6/dist-packages/keras/backend/tensorflow_backend.py", line 75, in symbolic_fn_wrapper return func(*args, **kwargs) File "/usr/local/lib/python3.6/dist-packages/keras/engine/training.py", line 222, in compile masks=masks) File "/usr/local/lib/python3.6/dist-packages/keras/engine/training.py", line 871, in _handle_metrics self._per_output_metrics[i], target, output, output_mask) File "/usr/local/lib/python3.6/dist-packages/keras/engine/training.py", line 842, in _handle_per_output_metrics metric_fn, y_true, y_pred, weights=weights, mask=mask) File "/usr/local/lib/python3.6/dist-packages/keras/engine/training_utils.py", line 1033, in call_metric_function update_ops = metric_fn.update_state(y_true, y_pred, sample_weight=weights) File "/usr/local/lib/python3.6/dist-packages/keras/utils/metrics_utils.py", line 42, in decorated update_op = update_state_fn(*args, **kwargs) File "/usr/local/lib/python3.6/dist-packages/keras/metrics.py", line 318, in update_state matches = self._fn(y_true, y_pred, **self._fn_kwargs) File "/home/x/文档/GitHub/noise2noise/model.py", line 45, in PSNR return 10.0 * tf_log10((max_pixel ** 2) / (K.mean(K.square(y_pred - y_true)))) File "/home/x/文档/GitHub/noise2noise/model.py", line 37, in tf_log10 numerator = tf.log(x) AttributeError: module 'tensorflow' has no attribute 'log'

@emontalbano
Copy link

pip install tensorflow==1.15

The developers didn't put any versions on their requirements.txt and v2+ doesn't work with their code.

playbyan1453 added a commit to playbyan1453/noise2noise that referenced this issue Nov 21, 2020
@neurocker
Copy link

change it to tf.math.log

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants