Closed anqin5211314 closed 5 years ago
pip install -e .
作者你好可以提供一份VESPCN的预训练权重吗?我的邮箱:634628344@qq.com
你可以直接用python prepare_data.py --filter vespcn
下载
其中vespcn.zip是tensorflow版,Tvespcn.zip是torch版。
楼主,不好意思 我想再问一下如果我想增强自己的视频的话,我应该把要处理的视频放在哪里呢?
你需要先把视频预处理成png序列:
- test
-- video1
--- frame0.png
--- frame1.png
--- ...
-- video2
--- frame0.png
...
之后用eval.py或者run.py:
python eval.py vespcn --cuda --pth somewhere/vespcn.pth --test ./test
or
python run.py --model vespcn --infer ./test --save_dir=../Results
其中../Results
底下放着解压缩后的vespcn.zip
: ../Results/vespcn/save/*.ckpt
谢谢楼主
楼主 再问你一下 我用你提供的命令下载预训练权重 必须要tf和pytorch都需要安装吗
如果你不跑pytorch模型的话就不用装pytorch。TF的话最好安上,可能可以脱离tf运行pytorch框架,但我没测试过。
因为我在下载预训练权重的时候 一直提示我 没有FT
楼主,把视频处理成png序列 你能说的具体一点吗?这个代码里有现成的可以实现这个功能的代码吗?
你可以直接用ffmpeg:
ffmpeg -i xx.mp4 -vsync 0 xx%04d.bmp -y
楼主为什么我一直行安装TF的命令电脑就很卡 还安装不成功 下了安装包也按不成功。tf版本太老了吗?
请参考官网,安装最新的版本。
楼主 tensorflow-gpu==1.12.0是不是只能呢个在python2.7下安装 ?
楼主你用的python2版本还是python3版本?
楼主 我真的是被环境搞崩溃了 安装VSR包需要python3.5以上版本 TF1.12.0又只能在python2.7版本下安装怎么办 急需楼主解答 非常感谢
linux默认环境的话用pip3 install ... 推荐直接用conda安装,具体谷歌或者必应都有详细教程。
楼主 我在运行 python run.py --model vespcn --infer ./test/video1 --save_dir=../Results 语句的时候,出现了如下错误: raise _exceptions.DuplicateFlagError.from_flag(name, self) absl.flags._exceptions.DuplicateFlagError: The flag 'v' is defined twice. 请楼主指点
把具体的log贴上来
(base) anqin@anqin-N85-87HP6:~/VideoSuperResolution/Train$ python run.py --model vespcn --infer ./test/video1 --save_dir=../Results
Traceback (most recent call last):
File "run.py", line 21, in
我后来把RUN.py里边line74(tf.flags.DEFINE_bool('v', False, help="show verbose info"))注释了 然后有了以下结果: (base) anqin@anqin-N85-87HP6:~/VideoSuperResolution/Train$ python run.py --model vespcn --infer ./test/video1 --save_dir=../Results WARNING: Logging before flag parsing goes to stderr. W0627 18:44:04.257138 140548795864832 deprecation_wrapper.py:119] From run.py:46: The name tf.app.run is deprecated. Please use tf.compat.v1.app.run instead.
W0627 18:44:04.377435 140548795864832 deprecation_wrapper.py:119] From /home/anqin/VideoSuperResolution/VSR/Framework/Trainer.py:84: The name tf.logging.INFO is deprecated. Please use tf.compat.v1.logging.INFO instead.
W0627 18:44:04.485724 140548795864832 deprecation_wrapper.py:119] From /home/anqin/VideoSuperResolution/VSR/Framework/Trainer.py:93: The name tf.logging.set_verbosity is deprecated. Please use tf.compat.v1.logging.set_verbosity instead.
W0627 18:44:04.531193 140548795864832 deprecation_wrapper.py:119] From /home/anqin/VideoSuperResolution/VSR/Framework/SuperResolution.py:82: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.
W0627 18:44:04.548097 140548795864832 deprecation_wrapper.py:119] From /home/anqin/VideoSuperResolution/VSR/Util/Utility.py:492: The name tf.mod is deprecated. Please use tf.math.mod instead.
W0627 18:44:04.596089 140548795864832 deprecation_wrapper.py:119] From /home/anqin/VideoSuperResolution/VSR/Models/Vespcn.py:102: The name tf.variable_scope is deprecated. Please use tf.compat.v1.variable_scope instead.
W0627 18:44:04.598606 140548795864832 deprecation_wrapper.py:119] From /home/anqin/VideoSuperResolution/VSR/Models/Vespcn.py:57: The name tf.AUTO_REUSE is deprecated. Please use tf.compat.v1.AUTO_REUSE instead.
W0627 18:44:04.599654 140548795864832 deprecation_wrapper.py:119] From /home/anqin/VideoSuperResolution/VSR/Framework/LayersHelper.py:264: The name tf.keras.initializers.he_normal is deprecated. Please use tf.compat.v1.keras.initializers.he_normal instead.
W0627 18:44:04.599941 140548795864832 deprecation_wrapper.py:119] From /home/anqin/VideoSuperResolution/VSR/Framework/LayersHelper.py:64: The name tf.layers.Conv2D is deprecated. Please use tf.compat.v1.layers.Conv2D instead.
W0627 18:44:04.822703 140548795864832 deprecation.py:323] From /home/anqin/VideoSuperResolution/VSR/Framework/Motion.py:83: to_float (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.cast
instead.
W0627 18:44:04.823256 140548795864832 deprecation.py:323] From /home/anqin/VideoSuperResolution/VSR/Framework/Motion.py:86: to_int32 (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.cast
instead.
W0627 18:44:05.341447 140548795864832 deprecation_wrapper.py:119] From /home/anqin/VideoSuperResolution/VSR/Models/Vespcn.py:119: The name tf.losses.mean_squared_error is deprecated. Please use tf.compat.v1.losses.mean_squared_error instead.
W0627 18:44:05.349648 140548795864832 deprecation.py:323] From /home/anqin/anaconda3/lib/python3.7/site-packages/tensorflow/python/ops/losses/losses_impl.py:121: add_dispatch_support.
W0627 18:44:05.415535 140548795864832 deprecation_wrapper.py:119] From /home/anqin/VideoSuperResolution/VSR/Models/Vespcn.py:128: The name tf.get_collection is deprecated. Please use tf.compat.v1.get_collection instead.
W0627 18:44:05.415731 140548795864832 deprecation_wrapper.py:119] From /home/anqin/VideoSuperResolution/VSR/Models/Vespcn.py:130: The name tf.train.AdamOptimizer is deprecated. Please use tf.compat.v1.train.AdamOptimizer instead.
W0627 18:44:06.667840 140548795864832 deprecation_wrapper.py:119] From /home/anqin/VideoSuperResolution/VSR/Framework/SuperResolution.py:147: The name tf.summary.scalar is deprecated. Please use tf.compat.v1.summary.scalar instead.
W0627 18:44:06.669442 140548795864832 deprecation_wrapper.py:119] From /home/anqin/VideoSuperResolution/VSR/Models/Vespcn.py:146: The name tf.summary.image is deprecated. Please use tf.compat.v1.summary.image instead.
W0627 18:44:06.688194 140548795864832 deprecation_wrapper.py:119] From /home/anqin/VideoSuperResolution/VSR/Framework/SuperResolution.py:87: The name tf.summary.merge_all is deprecated. Please use tf.compat.v1.summary.merge_all instead.
W0627 18:44:06.689034 140548795864832 deprecation_wrapper.py:119] From /home/anqin/VideoSuperResolution/VSR/Framework/SuperResolution.py:106: The name tf.train.Saver is deprecated. Please use tf.compat.v1.train.Saver instead.
2019-06-27 18:44:06.765331: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2019-06-27 18:44:06.787577: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2808000000 Hz
2019-06-27 18:44:06.788433: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x55b670bc5f90 executing computations on platform Host. Devices:
2019-06-27 18:44:06.788493: I tensorflow/compiler/xla/service/service.cc:175] StreamExecutor device (0):
I0627 18:44:07.485228 140548795864832 Trainer.py:232] Fitting: VESPCN W0627 18:44:07.485567 140548795864832 deprecation_wrapper.py:119] From /home/anqin/VideoSuperResolution/VSR/Framework/Trainer.py:234: The name tf.summary.FileWriter is deprecated. Please use tf.compat.v1.summary.FileWriter instead.
W0627 18:44:07.877272 140548795864832 Loader.py:179] frames is empty. [size=800] | 2019-06-27 18:44:07 | Epoch: 1/50 | LR: 0.0001 | 0batch [00:00, ?batch/s] W0627 18:44:07.911932 140548795864832 Loader.py:179] frames is empty. [size=10] Test: 0it [00:00, ?it/s]
Traceback (most recent call last): File "/home/anqin/anaconda3/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1356, in _do_call return fn(*args) File "/home/anqin/anaconda3/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1341, in _run_fn options, feed_dict, fetch_list, target_list, run_metadata) File "/home/anqin/anaconda3/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1429, in _call_tf_sessionrun run_metadata) tensorflow.python.framework.errors_impl.InvalidArgumentError: You must feed a value for placeholder tensor 'label' with dtype float and shape [?,3,?,?,3] [[{{node label}}]]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "run.py", line 46, in
Original stack trace for 'label':
File "run.py", line 46, in
(base) anqin@anqin-N85-87HP6:~/VideoSuperResolution/Train$ python run.py --model vespcn --infer ./test/video1 --save_dir=../Results/result WARNING: Logging before flag parsing goes to stderr. W0627 18:49:33.224781 140705305741056 deprecation_wrapper.py:119] From run.py:46: The name tf.app.run is deprecated. Please use tf.compat.v1.app.run instead.
W0627 18:49:33.231159 140705305741056 deprecation_wrapper.py:119] From /home/anqin/VideoSuperResolution/VSR/Framework/Trainer.py:84: The name tf.logging.INFO is deprecated. Please use tf.compat.v1.logging.INFO instead.
W0627 18:49:33.248182 140705305741056 deprecation_wrapper.py:119] From /home/anqin/VideoSuperResolution/VSR/Framework/Trainer.py:93: The name tf.logging.set_verbosity is deprecated. Please use tf.compat.v1.logging.set_verbosity instead.
W0627 18:49:33.261546 140705305741056 deprecation_wrapper.py:119] From /home/anqin/VideoSuperResolution/VSR/Framework/SuperResolution.py:82: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.
W0627 18:49:33.266616 140705305741056 deprecation_wrapper.py:119] From /home/anqin/VideoSuperResolution/VSR/Util/Utility.py:492: The name tf.mod is deprecated. Please use tf.math.mod instead.
W0627 18:49:33.308837 140705305741056 deprecation_wrapper.py:119] From /home/anqin/VideoSuperResolution/VSR/Models/Vespcn.py:102: The name tf.variable_scope is deprecated. Please use tf.compat.v1.variable_scope instead.
W0627 18:49:33.311449 140705305741056 deprecation_wrapper.py:119] From /home/anqin/VideoSuperResolution/VSR/Models/Vespcn.py:57: The name tf.AUTO_REUSE is deprecated. Please use tf.compat.v1.AUTO_REUSE instead.
W0627 18:49:33.312462 140705305741056 deprecation_wrapper.py:119] From /home/anqin/VideoSuperResolution/VSR/Framework/LayersHelper.py:264: The name tf.keras.initializers.he_normal is deprecated. Please use tf.compat.v1.keras.initializers.he_normal instead.
W0627 18:49:33.312716 140705305741056 deprecation_wrapper.py:119] From /home/anqin/VideoSuperResolution/VSR/Framework/LayersHelper.py:64: The name tf.layers.Conv2D is deprecated. Please use tf.compat.v1.layers.Conv2D instead.
W0627 18:49:33.518929 140705305741056 deprecation.py:323] From /home/anqin/VideoSuperResolution/VSR/Framework/Motion.py:83: to_float (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.cast
instead.
W0627 18:49:33.519441 140705305741056 deprecation.py:323] From /home/anqin/VideoSuperResolution/VSR/Framework/Motion.py:86: to_int32 (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.cast
instead.
W0627 18:49:34.024278 140705305741056 deprecation_wrapper.py:119] From /home/anqin/VideoSuperResolution/VSR/Models/Vespcn.py:119: The name tf.losses.mean_squared_error is deprecated. Please use tf.compat.v1.losses.mean_squared_error instead.
W0627 18:49:34.030744 140705305741056 deprecation.py:323] From /home/anqin/anaconda3/lib/python3.7/site-packages/tensorflow/python/ops/losses/losses_impl.py:121: add_dispatch_support.
W0627 18:49:34.092597 140705305741056 deprecation_wrapper.py:119] From /home/anqin/VideoSuperResolution/VSR/Models/Vespcn.py:128: The name tf.get_collection is deprecated. Please use tf.compat.v1.get_collection instead.
W0627 18:49:34.092759 140705305741056 deprecation_wrapper.py:119] From /home/anqin/VideoSuperResolution/VSR/Models/Vespcn.py:130: The name tf.train.AdamOptimizer is deprecated. Please use tf.compat.v1.train.AdamOptimizer instead.
W0627 18:49:35.319869 140705305741056 deprecation_wrapper.py:119] From /home/anqin/VideoSuperResolution/VSR/Framework/SuperResolution.py:147: The name tf.summary.scalar is deprecated. Please use tf.compat.v1.summary.scalar instead.
W0627 18:49:35.321401 140705305741056 deprecation_wrapper.py:119] From /home/anqin/VideoSuperResolution/VSR/Models/Vespcn.py:146: The name tf.summary.image is deprecated. Please use tf.compat.v1.summary.image instead.
W0627 18:49:35.339835 140705305741056 deprecation_wrapper.py:119] From /home/anqin/VideoSuperResolution/VSR/Framework/SuperResolution.py:87: The name tf.summary.merge_all is deprecated. Please use tf.compat.v1.summary.merge_all instead.
W0627 18:49:35.340448 140705305741056 deprecation_wrapper.py:119] From /home/anqin/VideoSuperResolution/VSR/Framework/SuperResolution.py:106: The name tf.train.Saver is deprecated. Please use tf.compat.v1.train.Saver instead.
2019-06-27 18:49:35.414117: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2019-06-27 18:49:35.439459: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2808000000 Hz
2019-06-27 18:49:35.440146: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x55f45a6aac50 executing computations on platform Host. Devices:
2019-06-27 18:49:35.440206: I tensorflow/compiler/xla/service/service.cc:175] StreamExecutor device (0):
I0627 18:49:35.786675 140705305741056 Trainer.py:232] Fitting: VESPCN W0627 18:49:35.786755 140705305741056 deprecation_wrapper.py:119] From /home/anqin/VideoSuperResolution/VSR/Framework/Trainer.py:234: The name tf.summary.FileWriter is deprecated. Please use tf.compat.v1.summary.FileWriter instead.
W0627 18:49:36.152463 140705305741056 Loader.py:179] frames is empty. [size=800] | 2019-06-27 18:49:36 | Epoch: 1/50 | LR: 0.0001 | 0batch [00:00, ?batch/s] W0627 18:49:36.154349 140705305741056 Loader.py:179] frames is empty. [size=10] Test: 0it [00:00, ?it/s]
Traceback (most recent call last): File "/home/anqin/anaconda3/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1356, in _do_call return fn(*args) File "/home/anqin/anaconda3/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1341, in _run_fn options, feed_dict, fetch_list, target_list, run_metadata) File "/home/anqin/anaconda3/lib/python3.7/site-packages/tensorflow/python/client/session.py", line 1429, in _call_tf_sessionrun run_metadata) tensorflow.python.framework.errors_impl.InvalidArgumentError: You must feed a value for placeholder tensor 'label' with dtype float and shape [?,3,?,?,3] [[{{node label}}]]
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "run.py", line 46, in
Original stack trace for 'label':
File "run.py", line 46, in
权重下载下来了么?查看一下../Results/vespcn/save下有没有文件。 另外这一堆warning是提示你升级tf2的,如果不想看就安装1.12版本,不要安装更新的。
有权重文件 vespcn_ep0500.pth 这个 不过我下载的是Tvespcn.zip 把它解压缩了
楼主 楼主 我下载的权重文件有问题吗?
T开头的压缩包是用于PyTorch的权重,就下vespcn.zip就行。
今天下载了TF 版本权重 运行了一下报了这样的问题: (base) anqin@anqin-N85-87HP6:~/VideoSuperResolution/Train$ python run.py --model vespcn --test vid4 WARNING: Logging before flag parsing goes to stderr. W0701 14:37:41.325764 140453722216192 deprecation_wrapper.py:119] From run.py:46: The name tf.app.run is deprecated. Please use tf.compat.v1.app.run instead.
W0701 14:37:41.332120 140453722216192 deprecation_wrapper.py:119] From /home/anqin/VideoSuperResolution/VSR/Framework/Trainer.py:84: The name tf.logging.INFO is deprecated. Please use tf.compat.v1.logging.INFO instead.
W0701 14:37:41.349386 140453722216192 deprecation_wrapper.py:119] From /home/anqin/VideoSuperResolution/VSR/Framework/Trainer.py:93: The name tf.logging.set_verbosity is deprecated. Please use tf.compat.v1.logging.set_verbosity instead.
W0701 14:37:41.361619 140453722216192 deprecation_wrapper.py:119] From /home/anqin/VideoSuperResolution/VSR/Framework/SuperResolution.py:82: The name tf.placeholder is deprecated. Please use tf.compat.v1.placeholder instead.
W0701 14:37:41.366799 140453722216192 deprecation_wrapper.py:119] From /home/anqin/VideoSuperResolution/VSR/Util/Utility.py:492: The name tf.mod is deprecated. Please use tf.math.mod instead.
W0701 14:37:41.408181 140453722216192 deprecation_wrapper.py:119] From /home/anqin/VideoSuperResolution/VSR/Models/Vespcn.py:102: The name tf.variable_scope is deprecated. Please use tf.compat.v1.variable_scope instead.
W0701 14:37:41.410676 140453722216192 deprecation_wrapper.py:119] From /home/anqin/VideoSuperResolution/VSR/Models/Vespcn.py:57: The name tf.AUTO_REUSE is deprecated. Please use tf.compat.v1.AUTO_REUSE instead.
W0701 14:37:41.411717 140453722216192 deprecation_wrapper.py:119] From /home/anqin/VideoSuperResolution/VSR/Framework/LayersHelper.py:264: The name tf.keras.initializers.he_normal is deprecated. Please use tf.compat.v1.keras.initializers.he_normal instead.
W0701 14:37:41.412005 140453722216192 deprecation_wrapper.py:119] From /home/anqin/VideoSuperResolution/VSR/Framework/LayersHelper.py:64: The name tf.layers.Conv2D is deprecated. Please use tf.compat.v1.layers.Conv2D instead.
W0701 14:37:41.618857 140453722216192 deprecation.py:323] From /home/anqin/VideoSuperResolution/VSR/Framework/Motion.py:83: to_float (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.cast
instead.
W0701 14:37:41.619404 140453722216192 deprecation.py:323] From /home/anqin/VideoSuperResolution/VSR/Framework/Motion.py:86: to_int32 (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.cast
instead.
W0701 14:37:42.124087 140453722216192 deprecation_wrapper.py:119] From /home/anqin/VideoSuperResolution/VSR/Models/Vespcn.py:119: The name tf.losses.mean_squared_error is deprecated. Please use tf.compat.v1.losses.mean_squared_error instead.
W0701 14:37:42.130584 140453722216192 deprecation.py:323] From /home/anqin/anaconda3/lib/python3.7/site-packages/tensorflow/python/ops/losses/losses_impl.py:121: add_dispatch_support.
W0701 14:37:42.191982 140453722216192 deprecation_wrapper.py:119] From /home/anqin/VideoSuperResolution/VSR/Models/Vespcn.py:128: The name tf.get_collection is deprecated. Please use tf.compat.v1.get_collection instead.
W0701 14:37:42.192173 140453722216192 deprecation_wrapper.py:119] From /home/anqin/VideoSuperResolution/VSR/Models/Vespcn.py:130: The name tf.train.AdamOptimizer is deprecated. Please use tf.compat.v1.train.AdamOptimizer instead.
W0701 14:37:43.439079 140453722216192 deprecation_wrapper.py:119] From /home/anqin/VideoSuperResolution/VSR/Framework/SuperResolution.py:147: The name tf.summary.scalar is deprecated. Please use tf.compat.v1.summary.scalar instead.
W0701 14:37:43.440698 140453722216192 deprecation_wrapper.py:119] From /home/anqin/VideoSuperResolution/VSR/Models/Vespcn.py:146: The name tf.summary.image is deprecated. Please use tf.compat.v1.summary.image instead.
W0701 14:37:43.460255 140453722216192 deprecation_wrapper.py:119] From /home/anqin/VideoSuperResolution/VSR/Framework/SuperResolution.py:87: The name tf.summary.merge_all is deprecated. Please use tf.compat.v1.summary.merge_all instead.
W0701 14:37:43.460900 140453722216192 deprecation_wrapper.py:119] From /home/anqin/VideoSuperResolution/VSR/Framework/SuperResolution.py:106: The name tf.train.Saver is deprecated. Please use tf.compat.v1.train.Saver instead.
2019-07-01 14:37:43.537641: I tensorflow/core/platform/cpu_feature_guard.cc:142] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2019-07-01 14:37:43.559492: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2808000000 Hz
2019-07-01 14:37:43.560404: I tensorflow/compiler/xla/service/service.cc:168] XLA service 0x55afcd513a30 executing computations on platform Host. Devices:
2019-07-01 14:37:43.560453: I tensorflow/compiler/xla/service/service.cc:175] StreamExecutor device (0):
W0701 14:37:44.022271 140453722216192 Loader.py:179] frames is empty. [size=-1] 是不是说加载不到我的测试数据
回顾了一下你之前的描述,用如下命令:
python run.py --model vespcn --infer ./test/ --save_dir=../Results
./test/ 下是若干video目录。如果还有其他问题,请私信一个微信号,我线下指导你。这个问题与VSR无关,我就关闭了
请问如何安装VSR包?