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._api.v2.train' has no attribute 'Optimizer' #10

Open
SuGoe-Young opened this issue Apr 21, 2023 · 1 comment

Comments

@SuGoe-Young
Copy link

SuGoe-Young commented Apr 21, 2023

Hi! I got this error while running eval code after done your step.
can you help me sovle this problem?

(```
crfnet_2) young@young-hislab:~/disk/code/study_master/crfnet$ python evaluate_crfnet.py --config configs/default.cfg --model saved_models/crf_net.h5 --st 0.5
Using TensorFlow backend.
2023-04-22 17:10:23.334967: I tensorflow/stream_executor/platform/default/dso_loader.cc:49] Successfully opened dynamic library libcudart.so.11.0
WARNING:tensorflow:From /home/young/anaconda3/envs/crfnet_2/lib/python3.6/site-packages/tensorflow/python/compat/v2_compat.py:96: disable_resource_variables (from tensorflow.python.ops.variable_scope) is deprecated and will be removed in a future version.
Instructions for updating:
non-resource variables are not supported in the long term

Loading NuScenes tables for version v1.0-mini...
23 category,
8 attribute,
4 visibility,
911 instance,
12 sensor,
120 calibrated_sensor,
31206 ego_pose,
8 log,
10 scene,
404 sample,
31206 sample_data,
18538 sample_annotation,
4 map,
Done loading in 0.3 seconds.

Reverse indexing ...
Done reverse indexing in 0.0 seconds.

Initializing data generator: / |# | 0 Elapsed Time: 0:00:00XXX lineno: 75, opcode: 0
An error occurred: unknown opcode

@foundnom
Copy link

foundnom commented Apr 7, 2024

I ran into a similar problem
i fixed it by changing 'tf.train.Optimizer' to 'tf.keras.optimizers.Optimizer'

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

2 participants