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

AssertionError #8

Closed
nengwp opened this issue Jul 19, 2020 · 9 comments
Closed

AssertionError #8

nengwp opened this issue Jul 19, 2020 · 9 comments

Comments

@nengwp
Copy link

nengwp commented Jul 19, 2020

I encountered such an error when I was running, can you tell me the reason?

Traceback (most recent call last):
File "/home/ubuntu/anaconda3/envs/tf2/bin/ut", line 33, in
sys.exit(load_entry_point('utime', 'console_scripts', 'ut')())
File "/home/ubuntu/tf2/U-Time/utime/bin/ut.py", line 55, in entry_func
mod.entry_func(parsed.args)
File "/home/ubuntu/tf2/U-Time/utime/bin/train.py", line 221, in entry_func
raise e
File "/home/ubuntu/tf2/U-Time/utime/bin/train.py", line 218, in entry_func
run(args=args, gpu_mon=gpu_mon)
File "/home/ubuntu/tf2/U-Time/utime/bin/train.py", line 192, in run
**hparams["fit"])
File "/home/ubuntu/tf2/U-Time/utime/train/trainer.py", line 118, in fit
raise e
File "/home/ubuntu/tf2/U-Time/utime/train/trainer.py", line 104, in fit
self._fit(batch_size=batch_size, **fit_kwargs)
File "/home/ubuntu/tf2/U-Time/utime/train/trainer.py", line 200, in _fit
verbose=verbose
File "/home/ubuntu/anaconda3/envs/tf2/lib/python3.7/site-packages/tensorflow/python/util/deprecation.py", line 324, in new_func
return func(*args, **kwargs)
File "/home/ubuntu/anaconda3/envs/tf2/lib/python3.7/site-packages/tensorflow/python/keras/engine/training.py", line 1479, in fit_generator
initial_epoch=initial_epoch)
File "/home/ubuntu/anaconda3/envs/tf2/lib/python3.7/site-packages/tensorflow/python/keras/engine/training.py", line 66, in _method_wrapper
return method(self, *args, **kwargs)
File "/home/ubuntu/anaconda3/envs/tf2/lib/python3.7/site-packages/tensorflow/python/keras/engine/training.py", line 876, in fit
callbacks.on_epoch_end(epoch, epoch_logs)
File "/home/ubuntu/anaconda3/envs/tf2/lib/python3.7/site-packages/tensorflow/python/keras/callbacks.py", line 365, in on_epoch_end
callback.on_epoch_end(epoch, logs)
File "/home/ubuntu/tf2/U-Time/utime/callbacks/callbacks.py", line 194, in on_epoch_end
TPs, relevant, selected, metrics = self.predict()
File "/home/ubuntu/tf2/U-Time/utime/callbacks/callbacks.py", line 87, in predict
assert len(metrics_names)-1 == len(metrics)
AssertionError
2020-07-19 21:34:52.871960: W tensorflow/core/kernels/data/generator_dataset_op.cc:103] Error occurred when finalizing GeneratorDataset iterator: Failed precondition: Python interpreter state is not initialized. The process may be terminated.
[[{{node PyFunc}}]]

@ghost
Copy link

ghost commented Sep 25, 2020

Did someone solve this?

@nengwp
Copy link
Author

nengwp commented Sep 25, 2020

有人解决了吗?

After I tried to use a brand new conda environment, the problem was solved. It may be a problem of relying on the library version. I hope to help you

@perslev
Copy link
Owner

perslev commented Sep 25, 2020

Hi!

This issue is likely linked to the version of tensorflow that you have installed. Would you mind sharing which version you are using?

Thanks
Kind regards
Mathias

@perslev
Copy link
Owner

perslev commented Sep 25, 2020

It should work with at least tensorflow 2.1 and 2.2 by the way.

@ghost
Copy link

ghost commented Sep 26, 2020

Upgrading tensorflow worked. Thank you.

@perslev
Copy link
Owner

perslev commented Sep 26, 2020

You're welcome 👍

@perslev perslev closed this as completed Sep 26, 2020
@ghost
Copy link

ghost commented Dec 8, 2020

I'm using tensorflow 2.3 and I get this error.

@perslev
Copy link
Owner

perslev commented Dec 9, 2020

Hi @sweta-r! Would you mind trying to fetch the latest version of the repository and re-install the package with pip? Minor changes have been made to the formatting of the hyperparameter file, so I would also suggest you re-run the ut init command to create a new, correctly formatted file.

Let me know if you encounter any issues.

Mathias

@ghost
Copy link

ghost commented Dec 11, 2020

Hi @perslev. Thank you for the quick response. This helped!

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