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

模型保存路径有问题 #85

Open
wangjianqiao111 opened this issue Apr 20, 2023 · 3 comments
Open

模型保存路径有问题 #85

wangjianqiao111 opened this issue Apr 20, 2023 · 3 comments

Comments

@wangjianqiao111
Copy link

wangjianqiao111 commented Apr 20, 2023

dt.save('/Users/wjq/Downloads/dtxx')
我把模型保存在'/Users/wjq/Downloads/dtxx'这个路径下,但这个路径下却为空。
w=dt.load('/Users/wjq/Downloads/dtxx'),当我从'/Users/wjq/Downloads/dtxx'这个路径load模型时发现其实deeptable并不是从'/Users/wjq/Downloads/dtxx'load模型的,而是从'/var/folders/g9/nwf7rmdd3nlfszr22lfg4lhc0000gn/T/workdir/Users/wjq/Downloads/dtxx/dt.pkl'这个路径下load模型的,请告诉我如何让模型保存在我指定的路径下

w=dt.load('/Users/wjq/Downloads/dtxx')
Traceback (most recent call last):
File "/Applications/anaconda3/lib/python3.7/site-packages/IPython/core/interactiveshell.py", line 3457, in run_code
exec(code_obj, self.user_global_ns, self.user_ns)
File "", line 1, in
w=dt.load('/Users/wjq/Downloads/dtxx')
File "/Users/wjq/wjq_home/hypergbm_venv/lib/python3.7/site-packages/deeptables/models/deeptable.py", line 801, in load
with fs.open(f'{filepath}dt.pkl', 'rb') as input:
File "/Users/wjq/wjq_home/hypergbm_venv/lib/python3.7/site-packages/hypernets/utils/_fsutils.py", line 131, in execute
result = fn(self.to_rpath(rpath), *args, **kwargs)
File "/Applications/anaconda3/lib/python3.7/site-packages/fsspec/spec.py", line 1043, in open
**kwargs,
File "/Applications/anaconda3/lib/python3.7/site-packages/fsspec/implementations/local.py", line 159, in _open
return LocalFileOpener(path, mode, fs=self, **kwargs)
File "/Applications/anaconda3/lib/python3.7/site-packages/fsspec/implementations/local.py", line 254, in init
self._open()
File "/Applications/anaconda3/lib/python3.7/site-packages/fsspec/implementations/local.py", line 259, in _open
self.f = open(self.path, mode=self.mode)
FileNotFoundError: [Errno 2] No such file or directory: '/var/folders/g9/nwf7rmdd3nlfszr22lfg4lhc0000gn/T/workdir/Users/wjq/Downloads/dtxx/dt.pkl'

@oaksharks
Copy link
Collaborator

Load deeptables model from directory by:

from deeptables.models import deeptable, deepnets
model_load = deeptable.DeepTable.load("/path/to/your/model")

References :

@wangjianqiao111
Copy link
Author

我知道怎么load模型,现在我的需求是把模型保存在我指定的路径下,而不是你们生成的‘/var/folders/g9/nwf7rmdd3nlfszr22lfg4lhc0000gn/T/workdir/’下面

@oaksharks
Copy link
Collaborator

oaksharks commented Apr 20, 2023

DeepTables requires a workdir to train or save models .
If you want to export the models for serving in another environment, please go to workdir to find the directory where you saved the model and copy it to the target environment's workdir to load.

Check workdir path pls refer to #91 .
Otherwise, you can also customize workdir pls refer to #75

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